• 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: [Newbie Q] Memory Management in Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
References: 
 >Re: [Newbie Q] Memory Management in Cocoa (From: Kevin Elliott <email@hidden>)

  • Prev by Date: RE: [Newbie Q] Memory Management in Cocoa
  • Next by Date: Re: [Newbie Q] Memory Management in Cocoa
  • Previous by thread: Re: [Newbie Q] Memory Management in Cocoa
  • Next by thread: RE: [Newbie Q] Memory Management in Cocoa
  • Index(es):
    • Date
    • Thread