• 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: creating instance using Class variable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: creating instance using Class variable


  • Subject: Re: creating instance using Class variable
  • From: Eliza Block <email@hidden>
  • Date: Wed, 20 Aug 2008 20:42:32 -0400

No error! I just assumed the thing I made it up out of thin air wasn't going to work.
Sorry about that, and thanks for setting me straight.


-Eliza

On Aug 20, 2008, at 8:36 PM, Charles Steinman wrote:

--- On Wed, 8/20/08, Eliza Block <email@hidden> wrote:

In short, I want to do something like this:
Class stringClass = [NSString class];
id myNewString = [[stringClass alloc] init];

But that doesn't work.

Yes it does. I mean, it creates a static empty string and thus isn't all that useful, but it works just as well as [[NSString alloc] init]. Why do think it doesn't work? What specifically is going wrong? Are you getting an error?


Cheers,
Chuck




_______________________________________________

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: 
 >Re: creating instance using Class variable (From: Charles Steinman <email@hidden>)

  • Prev by Date: Re: !foo vs foo == nil
  • Next by Date: Re: !foo vs foo == nil
  • Previous by thread: Re: creating instance using Class variable
  • Next by thread: Can't create pointer to custom class
  • Index(es):
    • Date
    • Thread