Re: [Newbie Q] Memory Management in Cocoa
Re: [Newbie Q] Memory Management in Cocoa
- Subject: Re: [Newbie Q] Memory Management in Cocoa
- From: Ondra Cada <email@hidden>
- Date: Wed, 6 Nov 2002 00:07:48 +0100
On Tuesday, November 5, 2002, at 11:53 , Kevin Elliott wrote:
The only justification I can think of is the visual "parallelism" between
[[object alloc] init] and [[object alloc] init: some_args...]
IIRC, pre-OpenStep it even was encouraged to make newWith... variants for
this, like
+(Foo*)newWithBar:bar {
return [[self alloc] initWithBar:bar];
}
I guess the reason to obsolete this whole stuff is that it is seldom
actually needed, and had it be used, it would add to the general
memory-management confusion. Better to use alloc/init explicitly just
since (a) it is not as convenient as an autoreleasing constructor, helping
thus newbies to select the proper variant since it's easier, and (b) it is
obvious what happen at first sight.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
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.