• 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: Charles Steinman <email@hidden>
  • Date: Wed, 20 Aug 2008 17:36:40 -0700 (PDT)

--- 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

  • Follow-Ups:
    • Re: creating instance using Class variable
      • From: Eliza Block <email@hidden>
References: 
 >creating instance using Class variable (From: Eliza Block <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: Re: creating instance using Class variable
  • Index(es):
    • Date
    • Thread