• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Memory Mania Revisted
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Memory Mania Revisted
      • From: Jonathan Hendry <email@hidden>
    • [OT] English, Was: Memory Mania Revisited
      • From: Nicholas Shanks <email@hidden>
References: 
 >Re: Memory Mania Revisted (From: Nicholas Shanks <email@hidden>)

  • Prev by Date: NSSliderCell private variables
  • Next by Date: [OT] English, Was: Memory Mania Revisited
  • Previous by thread: Re: Memory Mania Revisted
  • Next by thread: [OT] English, Was: Memory Mania Revisited
  • Index(es):
    • Date
    • Thread