• 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: [Foo new] vs [[Foo alloc] init]:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Foo new] vs [[Foo alloc] init]:


  • Subject: Re: [Foo new] vs [[Foo alloc] init]:
  • From: "Sean McBride" <email@hidden>
  • Date: Fri, 15 Feb 2008 16:18:09 -0500
  • Organization: Rogue Research

On 2/15/08 9:11 PM, Keith Duncan said:

>> As far as I understand, [Foo new] is exactly equivalent to [[Foo
>> alloc] init]
>
>Correct.
>
>Chaining alloc and init is just the in vogue convention as far as I
>know. I've been told that -new used to be a popular way of doing it
>back in the days of NeXTStep.
>
>There is noting wrong with using it though.

Well, 'new' is a reserved word in C++, so if you use Cocoa's 'new'
method you'll never be able to use Objective-C++ with that code.  It's
kind of like how using 'id' as a variable name in C++ is a bad idea.

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >In-loop releasing of objects does not free memory? (From: Arthur C. <email@hidden>)
 >Re: In-loop releasing of objects does not free memory? (From: John Terranova <email@hidden>)
 >Re: In-loop releasing of objects does not free memory? (From: John Stiles <email@hidden>)
 >RE: In-loop releasing of objects does not free memory? (From: Arthur C. <email@hidden>)
 >Re: In-loop releasing of objects does not free memory? (From: Randall Meadows <email@hidden>)
 >Re: In-loop releasing of objects does not free memory? (From: Uli Kusterer <email@hidden>)
 >Re: In-loop releasing of objects does not free memory? (From: Nick Zitzmann <email@hidden>)
 >Re: In-loop releasing of objects does not free memory? (From: Randall Meadows <email@hidden>)
 >Re: In-loop releasing of objects does not free memory? (From: Michael Watson <email@hidden>)
 >Re: In-loop releasing of objects does not free memory? (From: Keith Duncan <email@hidden>)
 >Re: In-loop releasing of objects does not free memory? (From: Jim Correia <email@hidden>)
 >Re: In-loop releasing of objects does not free memory? (From: Adam P Jenkins <email@hidden>)
 >Re: In-loop releasing of objects does not free memory? (From: Jim Correia <email@hidden>)
 >Re: In-loop releasing of objects does not free memory? (From: Adam P Jenkins <email@hidden>)
 >Re: In-loop releasing of objects does not free memory? (From: Keith Duncan <email@hidden>)
 >[Foo new] vs [[Foo alloc] init]: was Re: In-loop releasing of objects does not free memory? (From: Adam P Jenkins <email@hidden>)
 >Re: [Foo new] vs [[Foo alloc] init]: (From: Keith Duncan <email@hidden>)

  • Prev by Date: Another question about pool strategies
  • Next by Date: Re: Proper use of #define to aid in compile-time checking of strings (was KVC and KVO for arrays)
  • Previous by thread: Re: [Foo new] vs [[Foo alloc] init]:
  • Next by thread: Re: In-loop releasing of objects does not free memory?
  • Index(es):
    • Date
    • Thread