• 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: Do I "own" objects returned to me by reference?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Do I "own" objects returned to me by reference?


  • Subject: Re: Do I "own" objects returned to me by reference?
  • From: Shawn Erickson <email@hidden>
  • Date: Fri, 05 May 2006 19:40:22 -0700


On May 5, 2006, at 6:57 PM, Jerry Krinock wrote:

For example, in NSScanner we have:

- (BOOL)scanString:(NSString *)string intoString:(NSString **) stringValue ;

Should I -release stringValue when I am done with it, or has it been
autoreleased?

You see alloc or copy anyplace? :)

Is there a memory-management convention for objects returned by reference
like this?

Just the normal Cocoa convention. If you didn't alloc, copy it, or retain it then you don't need to send it a release/autorelease.


-Shawn
_______________________________________________
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


  • Follow-Ups:
    • Re: Do I "own" objects returned to me by reference?
      • From: "Adam R. Maxwell" <email@hidden>
References: 
 >Do I "own" objects returned to me by reference? (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Cocoa-heads Lake Forest next week, 5/9, now with free stuff!
  • Next by Date: Re: Do I "own" objects returned to me by reference?
  • Previous by thread: Do I "own" objects returned to me by reference?
  • Next by thread: Re: Do I "own" objects returned to me by reference?
  • Index(es):
    • Date
    • Thread