• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: GC pros and cons
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: GC pros and cons
      • From: James Gregurich <email@hidden>
References: 
 >Re: GC pros and cons (From: "Stephen J. Butler" <email@hidden>)
 >Re: GC pros and cons (From: Peter Ammon <email@hidden>)
 >Re: GC pros and cons (From: Kyle Sluder <email@hidden>)
 >Re: GC pros and cons (From: Peter Ammon <email@hidden>)
 >Re: GC pros and cons (From: Kyle Sluder <email@hidden>)
 >Re: GC pros and cons (From: Peter Ammon <email@hidden>)
 >Re: GC pros and cons (From: Bill Bumgarner <email@hidden>)
 >Re: GC pros and cons (From: Peter Ammon <email@hidden>)
 >Re: GC pros and cons (From: James Gregurich <email@hidden>)

  • Prev by Date: Re: GC pros and cons
  • Next by Date: Re: GC pros and cons
  • Previous by thread: Re: GC pros and cons
  • Next by thread: Re: GC pros and cons
  • Index(es):
    • Date
    • Thread