Re: Methods that return autoreleased objects?

2008-06-30 Thread Tom Bunch
On Jun 29, 2008, at 9:42 AM, Mike Ferris wrote: And, as long as we're on the topic... who can name the only other exceptional case for the release only if you alloc,new, copy or retain rule? (It's pretty old-school...) How about if you're implementing an initializer for a class cluster

Re: Methods that return autoreleased objects?

2008-06-29 Thread mmalc crawford
On Jun 28, 2008, at 9:59 PM, Charles Srstka wrote: Methods that begin with alloc or new or contain copy will return objects you are responsible for. All other objects returned from methods are taken care of. Well, there is the notable exception of top-level objects loaded from a NIB

Re: Methods that return autoreleased objects?

2008-06-29 Thread Charles Srstka
On Jun 29, 2008, at 1:58 AM, mmalc crawford wrote: On Jun 28, 2008, at 9:59 PM, Charles Srstka wrote: Methods that begin with alloc or new or contain copy will return objects you are responsible for. All other objects returned from methods are taken care of. Well, there is the notable

Re: Methods that return autoreleased objects?

2008-06-29 Thread mmalc crawford
On Jun 29, 2008, at 8:02 AM, Charles Srstka wrote: Yes, but it's not obvious, which is why I thought to point it out since we're discussing the times when you should and shouldn't release objects. The alloc, init, and retain methods are also documented, but that doesn't mean we can't help

Re: Methods that return autoreleased objects?

2008-06-29 Thread Mike Ferris
Best thing to do about the top-level nib exception to the rule is to use NSWindowController or NSViewController to do your nib loading. These classes properly take responsibility for top-level objects of the nibs they load and then all you have to do is manage the lifetime of the

Methods that return autoreleased objects?

2008-06-28 Thread john muchow
The last thread that I saw on this topic was dated sometime in 2004if there is something more recent that I didn't find, I apologize up front... I realize nothing has probably changed as far as the API and the documentation to indicate autoreleased methods, however, can someone provide any

Re: Methods that return autoreleased objects?

2008-06-28 Thread Shawn Erickson
On Sat, Jun 28, 2008 at 5:25 PM, john muchow [EMAIL PROTECTED] wrote: The last thread that I saw on this topic was dated sometime in 2004if there is something more recent that I didn't find, I apologize up front... I realize nothing has probably changed as far as the API and the

Re: Methods that return autoreleased objects?

2008-06-28 Thread Markus Spoettl
On Jun 28, 2008, at 5:25 PM, john muchow wrote: The last thread that I saw on this topic was dated sometime in 2004if there is something more recent that I didn't find, I apologize up front... I realize nothing has probably changed as far as the API and the documentation to indicate

Re: Methods that return autoreleased objects?

2008-06-28 Thread Owen Yamauchi
to release it somewhere else as appropriate. If you make an object with +alloc or -copy, then you'll need to release it somewhere too. In practice, most framework methods return autoreleased objects (if the method creates it). There are other situations, for example: -[NSArray objectAtIndex

RE: Methods that return autoreleased objects?

2008-06-28 Thread Omar Qazi
that return autoreleased objects? On Sat, Jun 28, 2008 at 5:25 PM, john muchow [EMAIL PROTECTED] wrote: The last thread that I saw on this topic was dated sometime in 2004if there is something more recent that I didn't find, I apologize up front... I realize nothing has probably changed as far

Re: Methods that return autoreleased objects?

2008-06-28 Thread Charles Srstka
On Jun 28, 2008, at 7:43 PM, Markus Spoettl wrote: Methods that begin with alloc or new or contain copy will return objects you are responsible for. All other objects returned from methods are taken care of. Well, there is the notable exception of top-level objects loaded from a NIB