Re: GC pros and cons
Re: GC pros and cons
- Subject: Re: GC pros and cons
- From: "Stephen J. Butler" <email@hidden>
- Date: Fri, 26 Jun 2009 00:13:07 -0500
On Fri, Jun 26, 2009 at 12:06 AM, James Gregurich<email@hidden> 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 (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:
This email sent to email@hidden