Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newb Question re NSUserDefaults and Ints




On 30 Aug 2008, at 12:14 pm, Andrei Kolev wrote:

Brad,

You can't store an int into [...] user defaults.

Sure you can:

- (void)setInteger:(NSInteger)value forKey:(NSString *)defaultName;



Note that NSInteger == int, so the book doesn't have a typo, it's just using the pre-Leopard type conventions.



But anyway, the angle used by NSGradient is a float, not an int, so you probably want:

- (void)setFloat:(float)value forKey:(NSString *)defaultName



Note that, again, CGFloat == float.



hth,

Graham








_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Newb Question re NSUserDefaults and Ints (From: Brad Gibbs <email@hidden>)
 >Re: Newb Question re NSUserDefaults and Ints (From: Andrei Kolev <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.