Re: Sending messages to nil on Intel
Re: Sending messages to nil on Intel
- Subject: Re: Sending messages to nil on Intel
- From: Greg Hurrell <email@hidden>
- Date: Tue, 2 Aug 2005 13:48:19 +0200
El 02/08/2005, a las 0:40, Felix Schwarz escribió:
So, just so I got things right: as long as I expect back an object
as return value, I may still stack calls. However I should not
stack calls, if I expect anything else like an integer value or a
pointer?
That is correct. The *only* time you should nest is when you expect
object (id) return values. If you break this rule it will "often"
work on ppc, "sometimes" work on i386, but in all cases you'll be
deviating from the Objective-C guidelines that have been in place
since long before Apple announced the move to Intel.
An idiom that I commonly use to make my code as compact *and* correct
as possible is this one:
NSNumber *number = [dictionary objectForKey:@"key"];
if (number && [number boolValue])
[self doSomething];
Greg
_______________________________________________
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