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

Re: NSUserDefaults


  • Subject: Re: NSUserDefaults
  • From: Steven Degutis <email@hidden>
  • Date: Thu, 3 Sep 2009 16:11:09 -0500

As NSString, NSData, NSDictionary, etc are derived from NSObject, they can
be easily set with -setObject:forKey:, whereas int, float, NSInteger, etc
are scalar types and thus cannot be set with this method. Thus, they have
convenient setters/getters, whereas object types have convenient getters
only. (Why they aren't balanced is beyond me.)
--
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.org/


On Thu, Sep 3, 2009 at 4:05 PM, Oftenwrong Soong
<email@hidden>wrote:

> Hi all,
>
> Why does NSUserDefaults provide method stringForKey but not a method
> setString:forKey (akin to setBool:forKey, setFloat:forKey, etc.)? This does
> not seem symmetric.
>
> I'm using setObject:forKey when saving a NSString to the defaults database.
> Is this correct?
>
> Thanks,
> Soong
>
>
>
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >NSUserDefaults (From: Oftenwrong Soong <email@hidden>)

  • Prev by Date: NSUserDefaults
  • Next by Date: Re: NSControlTextDidChangeNotification - What key pressed?
  • Previous by thread: NSUserDefaults
  • Next by thread: Re: NSUserDefaults
  • Index(es):
    • Date
    • Thread