Universal Binaries and messages to nil
Universal Binaries and messages to nil
- Subject: Universal Binaries and messages to nil
- From: Conor Dearden <email@hidden>
- Date: Mon, 06 Feb 2006 09:20:39 +0100
>Note: With the release of Xcode 2.2, Objective-C messages sent to a nil object
behave the same on both PowerPC and Intel-based Macintosh computers.
You no longer have to worry about it.
>On Intel-based Macintosh computers, messages to a nil object always return 0.0
for methods whose return type is float, double, long double, or long long.
So your code:
NSNumber *marginWidthNumber = [[NSUserDefaults
standardUserDefaults] objectForKey:@"SCRMarginWidth"];
float marginWidth = (marginWidthNumber != nil) ?
[marginWidthNumber floatValue] : 0.0;
Is the same as:
float marginWidth = [[[NSUserDefaults
standardUserDefaults] objectForKey:@"SCRMarginWidth"]
floatValue];
You are still going to get 0.0.
Regards,
Conor
_______________________________________________
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