• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSUserDefaults not resetting....
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSUserDefaults not resetting....


  • Subject: Re: NSUserDefaults not resetting....
  • From: Craig Phillips <email@hidden>
  • Date: Thu, 15 Sep 2005 09:48:30 +1000

No probs Aaron,

there are two types of methods you can call on Obj C classes, the most commonly used are your standard instance methods. If you look at some of the standard docs' you will see these are prefixed by a "-" the other type used at initialisation or for getting shared instances are class methods and are prefixed with a "+"

Download AppKiDo and browse around some of the Cocoa classes and you can see the class methods clearly separated out from instance methods.

In your case you would be calling...


[NSUserDefaults resetStandardUserDefaults]


On 14/09/2005, at 08:01, Aaron Wallis wrote:

Hi Craig,

thanks for the pointer !

You'll have to excuse me, but im still a bit of a newbie - so what does that mean?
how do I call resetStandardUserDefaults?


Cheers.

On 14/09/2005, at 12:05 AM, Craig Phillips wrote:


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:
40yahoo.com.au


This email sent to email@hidden



Send instant messages to your online friends http:// au.messenger.yahoo.com



_______________________________________________ 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
References: 
 >NSUserDefaults not resetting.... (From: Aaron Wallis <email@hidden>)
 >Re: NSUserDefaults not resetting.... (From: Craig Phillips <email@hidden>)

  • Prev by Date: Re: Disabling Display of JPG and PDF Files in NSTextView
  • Next by Date: Getting a FSVolumeRefNum from NSString
  • Previous by thread: RE: NSUserDefaults not resetting....
  • Next by thread: Re: File comments!
  • Index(es):
    • Date
    • Thread