Re: Universal Binaries and messages to nil
Re: Universal Binaries and messages to nil
- Subject: Re: Universal Binaries and messages to nil
- From: glenn andreas <email@hidden>
- Date: Sun, 5 Feb 2006 16:20:35 -0600
Currently, I often lazily rely on a message to (what
should be) an NSNumber returning zero if the NSNumber
is actually nil, especially when dealing with user
defaults, as in the following example:
float marginWidth = [[[NSUserDefaults
standardUserDefaults] objectForKey:@"SCRMarginWidth"]
floatValue];
Why not use:
float marginWidth = [[NSUserDefaults standardUserDefaults]
floatForKey: @"SCRMarginWidth"];
(this doesn't solve the general problem of "how to best handle nil
receivers and floating point return values" but does take care of the
specific example)
Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
quadrium | build, mutate, evolve | images, textures, backgrounds, art
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden