• 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: Which class methods return autoreleased objects?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Which class methods return autoreleased objects?


  • Subject: Re: Which class methods return autoreleased objects?
  • From: Charlton Wilbur <email@hidden>
  • Date: Mon, 6 Dec 2004 23:43:32 -0500


On Dec 6, 2004, at 11:00 PM, M. Uli Kusterer wrote:

Actually, it *can* be larger than the current function/method, but you shouldn't rely on it. The default autorelease pool, for example, is created after the first user action (e.g. after the user chooses a menu item) and is released when your code returns control to Cocoa (and thus to the user).

This also masked an error in some code I wrote recently: it was a complicated Model class, so I wrote it and then wrote a test suite as a Cocoa shell tool. The problem was, there was a bug in an accessor function that didn't retain the object passed in -- but because the autorelease pool persisted throughout the program, and the object that was passed in had been autoreleased, the bug didn't show up. And because the Model class passed the test suite, it was the *last* place I was prepared to look for bugs....


Charlton


-- Charlton Wilbur email@hidden email@hidden

_______________________________________________
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


References: 
 >Which class methods return autoreleased objects? (From: Jeremy French <email@hidden>)
 >Re: Which class methods return autoreleased objects? (From: Ricky Sharp <email@hidden>)
 >Re: Which class methods return autoreleased objects? (From: Gwynne <email@hidden>)
 >Re: Which class methods return autoreleased objects? (From: "M. Uli Kusterer" <email@hidden>)

  • Prev by Date: Re: Which class methods return autoreleased objects?
  • Next by Date: Re: Release understanding help…
  • Previous by thread: Re: Which class methods return autoreleased objects?
  • Next by thread: Re: Which class methods return autoreleased objects?
  • Index(es):
    • Date
    • Thread