Re: self release
Re: self release
- Subject: Re: self release
- From: Wolfgang Ante <email@hidden>
- Date: Mon, 12 May 2003 22:35:26 +0200
I disagree with this! The best way to handle this is a Wolfgang first
stated. Of course there should be comments in the right places.
Hm, interesting discussion. Although not about [self release] anymore.
:-)
A factory method to create the object have a comment saying that these
objects are released in the suicide method.
And not autoreleased? Like this:
MyWorkingBee *bee = [MyWorkingBee workingBeeWithWorkDesc:info];
// now it stays...
[bee runInBackgroundAndRelease];
// and now it goes...
I think a factory method should always return autoreleased objects.
I agree if you meant an init method, like here:
MyWorkingBee *bee = [[MyWorkingBee alloc] initWithWorkDesc:info];
[bee runInBackground];
[bee release];
This is just for the "looks": From looking at this snippet it looks
like not leaking.
Or like sinclair44 suggested:
MyWorkingBee *bee = [[MyWorkingBee alloc] initWithWorkDesc:info];
[bee runInBackgroundAndReleaseWhenDone];
Although I don't like it, personally.
Well, I better stop now, I think I am beating this topic to death... ;-)
Bye, Wolfgang :-)
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.