Re: NSUserDefaults objects
Re: NSUserDefaults objects
- Subject: Re: NSUserDefaults objects
- From: Robert Walker <email@hidden>
- Date: Wed, 22 Mar 2006 15:16:15 -0500
Chris,
Since you are not allocating or copying the object returned by
objectForKey: then you should not be responsible for releasing it.
In this case (as per the memory management documentation) I would
assume that I am receiving an autoreleased object. Then I would
retain it only if I want to keep a reference to it (like when I store
the object in an instance variable).
On Mar 22, 2006, at 2:59 PM, Chris Lewis wrote:
Hi guys, just a quick one:
When I do this:
NSData *colorAsData = [[NSUserDefaults standardUserDefaults]
objectForKey:CFLRecogColor];
What exactly to I get back? Do I get an autoreleased new object or do
I get a reference to an object that already exists? Do I want to
retain/release this?
Thanks!
Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com
This email sent to email@hidden
--
Robert Walker
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden