• 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: David Rehring <email@hidden>
  • Date: Sun, 10 Feb 2002 12:38:31 -0800

On 2/10/02 10:03 AM, Nicholas Shanks at email@hidden 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?

Sometimes.

It depends on the specific implementation for each class. Some classes may
choose to 'cache' instances of themselves, so the first time through, they
may just call through to alloc/init, but subsequently, they would return the
same object instead of creating a new one.

Ideally, the documentation should clearly spell out the differences, if any,
there would be between new and alloc/init, for each class that supports new.

Slightly less ideally, you should check the implementation to see what the
difference is, if any.

Unfortunately, you're stuck with less-than-ideal documentation...

Later,
--
David Rehring Psychos do not explode when light hits
Senior Software Engineer them, no matter how crazy they are...
Atimi Software, Inc.
www.atimi.com And totally insane guy!
_______________________________________________
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.

References: 
 >Re: Memory Mania Revisted (From: Nicholas Shanks <email@hidden>)

  • Prev by Date: NSView's DrawRect
  • Next by Date: Re: about help
  • Previous by thread: Re: Memory Mania Revisted
  • Next by thread: Re: Memory Mania Revisted
  • Index(es):
    • Date
    • Thread