Re: controllers, delegates, retain, release ...

2008-02-22 Thread Nir Soffer
On Feb 22, 2008, at 20:39, Jack Repenning wrote: I have some code inherited from someone else (so I have no answers to why it's the way it presently is) that's handling retention in a way I find confusing, and think is not in accordance with the spirit of the law. But I can't quite figure

Re: controllers, delegates, retain, release ...

2008-02-22 Thread Jack Repenning
Interesting discussion, thanks. Not surprising, I suppose, if there's some split on a "matter of taste" like whether it's legitimate to have an object manage its own lifecycle ([self autorelease]). FWIW, I chose Quincey's solution, [[alloc]init]autorelease] in Controller, and [[super init

Re: controllers, delegates, retain, release ...

2008-02-22 Thread j o a r
On Feb 23, 2008, at 12:10 AM, Adam P Jenkins wrote: Where is this magic documented? The documentation for CFRetain doesn't mention this usage. See: Using CFRetain on an object doesn't quite

Re: controllers, delegates, retain, release ...

2008-02-22 Thread Adam P Jenkins
On Feb 22, 2008, at 5:17 PM, Charles Steinman wrote: --- Jack Repenning <[EMAIL PROTECTED]> wrote: On Feb 22, 2008, at 1:13 PM, Keith Duncan wrote: This would be a problem should the code base ever be compiled with GC support. Interesting point, that retain/release supports a lifecycle

Re: controllers, delegates, retain, release ...

2008-02-22 Thread Charles Steinman
--- Jack Repenning <[EMAIL PROTECTED]> wrote: > On Feb 22, 2008, at 1:13 PM, Keith Duncan wrote: > > This would be a problem should the code base ever > be compiled with > > GC support. > > Interesting point, that retain/release supports a > lifecycle model > (free-floating, self-managed obj

Re: controllers, delegates, retain, release ...

2008-02-22 Thread Jack Repenning
On Feb 22, 2008, at 1:13 PM, Keith Duncan wrote: This would be a problem should the code base ever be compiled with GC support. Interesting point, that retain/release supports a lifecycle model (free-floating, self-managed object) that can't be supported by GC -==- Jack Repenning Chief

Re: controllers, delegates, retain, release ...

2008-02-22 Thread Keith Duncan
FWIW, I wouldn't call it wrong for an object to manage its own lifetime. You'll leak UIs if the notification never appears, but this is apparently not a problem. This would be a problem should the code base ever be compiled with GC support. Granted that is unlikely as this is an existing co

Re: controllers, delegates, retain, release ...

2008-02-22 Thread Quincey Morris
On Feb 22, 2008, at 10:39, Jack Repenning wrote: In the current structure, Controller performs { UI *ui = [[UI alloc] initWithContext: context]; [ui run: @selector(doSomething) title: @"Title"]; } That is: the UI object is alloc'ed (creating a release obligation), but is not (auto)released

controllers, delegates, retain, release ...

2008-02-22 Thread Jack Repenning
I have some code inherited from someone else (so I have no answers to why it's the way it presently is) that's handling retention in a way I find confusing, and think is not in accordance with the spirit of the law. But I can't quite figure out how to do it "right". Is there a pattern I s