Re: NSUserDefaults
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