• 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: David Catmull <email@hidden>
  • Date: Fri, 15 Feb 2008 13:47:02 -0800

On Feb 15, 2008, at 1:20 PM, email@hidden wrote:
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.

Actually, that's not true. You can use C++ keywords as method names in Objective-C++; I've done it (specifically +class) without problems. Method names just aren't treated quite the same as other identifiers. The only thing is the syntax colorer highlights them as keywords.


--
David Catmull
email@hidden
http://www.uncommonplace.com/

_______________________________________________

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


  • Prev by Date: Re: NSShadow changes on 10.5.2?
  • Next by Date: Re: [Foo new] vs [[Foo alloc] init]:
  • Previous by thread: Another question about pool strategies
  • Next by thread: Re: [Foo new] vs [[Foo alloc] init]:
  • Index(es):
    • Date
    • Thread