• 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 and bools.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nsuserdefaults and bools.


  • Subject: Re: nsuserdefaults and bools.
  • From: Nick Zitzmann <email@hidden>
  • Date: Sat, 19 Apr 2003 08:28:23 -0700

On Friday, April 18, 2003, at 07:11 PM, Francisco Tolmasky wrote:

I know I can set a bool using setBool:forKey: in NSUserDefaults, but when I register my defaults, how do I do this within the Dictionary I pass in. In other words, how do I store the bool in my dictionary, is it similar to the way you archive bools?

You can use NSNumber as a wrapper to store a BOOL (or any other number) into a dictionary. Then, when you store the dictionary into the user defaults, the boolean value will be typedef'd correctly. Check the NSNumber documentation for more information...

Nick Zitzmann
AIM/iChat: dragonsdontsleep
Check out my software page: http://dreamless.home.attbi.com/

"Building the future and keeping the past alive are one and the same thing." - Metal Gear Solid 2
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
  • Follow-Ups:
    • Re: nsuserdefaults and bools.
      • From: Bill Cheeseman <email@hidden>
References: 
 >nsuserdefaults and bools. (From: Francisco Tolmasky <email@hidden>)

  • Prev by Date: Saving Custom Attributes [SOLVED, sort of...]
  • Next by Date: NSTask from a foundation tool?
  • Previous by thread: Re: nsuserdefaults and bools.
  • Next by thread: Re: nsuserdefaults and bools.
  • Index(es):
    • Date
    • Thread