• 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: Preferences using NSUserDefaults (newbie)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Preferences using NSUserDefaults (newbie)


  • Subject: Re: Preferences using NSUserDefaults (newbie)
  • From: Matt Ridley <email@hidden>
  • Date: Thu, 21 Jun 2001 19:22:41 +0100

On 21/6/01 11:10 am, Jorge Salvador Caffarena <email@hidden> wrote:

> Also they show some code to initialize the preferences for the first
> time, and they use this:

> [defaultPrefs setBool: YES forKey: somePrefOnOrOff];

> But the compiler complaints here and says that "NSMutableDictionary do
> not respond to setBool:forKey message".


That's true; it's an error in the sample code at CocoaDevCentral. Instead,
use this:

[defaultPrefs setObject: YES forKey: somePrefOnOrOff];

If you look at the documentation for NSMutableDictionary, you'll see what
methods it does and doesn't support.


--
// Matt

- (void)sendMeEmail {
[[NSWorkspace sharedWorkspace] openURL:
[NSURL URLWithString:@"mailto:email@hidden";]];
}


References: 
 >Preferences using NSUserDefaults (newbie) (From: Jorge Salvador Caffarena <email@hidden>)

  • Prev by Date: Re: WWDC Dev Tools / Software update
  • Next by Date: Re: Multiple NSTableView question
  • Previous by thread: Preferences using NSUserDefaults (newbie)
  • Next by thread: Re: Preferences using NSUserDefaults (newbie)
  • Index(es):
    • Date
    • Thread