Re: Memory Mania Revisted
Re: Memory Mania Revisted
- Subject: Re: Memory Mania Revisted
- From: Lance Bland <email@hidden>
- Date: Sun, 10 Feb 2002 13:30:09 -0500
On Sunday, February 10, 2002, at 01:03 PM, Nicholas Shanks wrote:
So, from what I've gathered reading this (rather interesting) thread,
[NSSomeObject new] is entirely equivalent to/synonymous with
[[NSSomeObject alloc] init]
Is this correct?
From what I remember:
new is probably implemented like this (I haven't checked in a long time):
+(id)new
{
return [[[self class] alloc] init];
}
but for some things like shared open panels, new use to be (maybe still
is) implemented something like this:
+(id)new
{
static sharedPanel = nil;
if(sharedPanel == nil)
{
sharedPanel = [[[self class] alloc] init];
}
return sharedPanel;
}
At one point, if memory serves, the docs use to say new was depreciated,
but it looks like it no longer says that. I wouldn't use new. I don't
use new so the subject is of little interest to me and I haven't payed
attention to the thread so the above may have been said at one point.
-lance
_______________________________________________
Lance Bland
System Administrator at VVI
mailto:email@hidden
http://www.vvi.com
Realtime, bulk and web data reporting and visualization
_______________________________________________
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.