On Fri, Jun 26, 2009 at 12:06 AM, James Gregurich<bayoubenga...@mac.com> wrote:
> I also take advantage of references in C++ to pass objc objects around
> without having to do null checks all over the place to keep code resilent.
>
> -(void) passMyObject: (NSObject&) theObj
> {
>        NSLog(@"%@", &theObj);
> }
>
> since the function takes a reference, client code knows never to pass a null
> to the function.

Huh? When you call the function, don't you have to eventually do
[something passMyObject:*anObject]? To me, that doesn't eliminate the
nil check, just move it somewhere else.

Also, messaging nil objects isn't a problem. It's only an issue with
the collections.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to