• 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
Instantiating an object by class from an NSString?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Instantiating an object by class from an NSString?


  • Subject: Instantiating an object by class from an NSString?
  • From: "M. Carlson" <email@hidden>
  • Date: Sat, 11 Feb 2006 04:22:21 +0000

If I have the class namestring of a Cocoa class in an NSString, e.g., like this:

NSString *myClassName = @"NSArray";

...how can I use the class specified in variable 'myClassName' to instantiate a member of this class (in this example, an NSArray)?

--M


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Instantiating an object by class from an NSString?
      • From: Omar Qazi <email@hidden>
  • Prev by Date: Re: Accessing *other* applications' windows?
  • Next by Date: Re: Instantiating an object by class from an NSString?
  • Previous by thread: Re: Is C's parameter passing more-efficient than ObjC's message passing?
  • Next by thread: Re: Instantiating an object by class from an NSString?
  • Index(es):
    • Date
    • Thread