RE: NSUserDefaults not resetting....
RE: NSUserDefaults not resetting....
- Subject: RE: NSUserDefaults not resetting....
- From: "Christopher Hickman" <email@hidden>
- Date: Tue, 13 Sep 2005 17:21:44 -0400
Whoa, the doc says that +[NSUserDefaults resetStandardUserDefaults]
"Synchronizes any changes made to the shared user defaults object and
releases it from memory. A subsequent invocation of standardUserDefaults
creates a new shared user defaults object with the standard search list."
Does that mean that it will be released regardless of its reference count?
I know it is a bad idea to retain singletons anyway, but that just seems
odd.
-----Original Message-----
From: cocoa-dev-bounces+tophu=email@hidden
[mailto:cocoa-dev-bounces+tophu=email@hidden] On Behalf Of Craig
Phillips
Sent: Tuesday, September 13, 2005 10:05 AM
To: email@hidden
Subject: Re: NSUserDefaults not resetting....
On 13/09/2005, at 23:10, Aaron Wallis wrote:
> Hey all...
>
> Just a quick question about the NSUserDefaults object.
>
> I have a UserDefault variable which is a singleton set in the header:
>
> NSUserDefaults * preferenceData;
>
> Now, when I try to reset the preferences [ through a button on the
> interface ] using the following code:
>
> - ( void ) resetPreferences
> {
> NSLog(@"reset preferences - this is not working !!!");
> [ preferenceData resetStandardUserDefaults ];
>
resetStandardUserDefaults is a Class method, but here you are calling
it against an instance that I assume you've gotten earlier...
> [ self setDefaultPreferences ];
> }
>
> Where setDefaultPreferences is a method that sets up the default
> prefs.
>
> This code is returning the error:
> NSUserDefaults may not respond to -resetStandardUserDefaults?
>
> Any idea what im doing wrong?
> I would have thought this would have worked scenes its in the
> documentation!?
>
> Cheers
> _______________________________________________
> 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
>
_______________________________________________
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
_______________________________________________
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