• 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
Class lookup at runtime
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Class lookup at runtime


  • Subject: Class lookup at runtime
  • From: "Wesley Smith" <email@hidden>
  • Date: Fri, 7 Dec 2007 01:41:55 -0800

Hi,
I'm trying to figure out how to dynamically get access to a class
instance from a string.  Let's say I have a C string with
"NSRectangle" in it.  Is there a way to find the NSRectangle class and
then call alloc on it to generate an instance?  I see how to get a
Selector from a string, but I haven't found anything about getting a
class object.  Is there some part of the Obj-C runtime I can ask for
this info?

thanks,
wes
_______________________________________________

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: Class lookup at runtime
      • From: "John Engelhart" <email@hidden>
    • Re: Class lookup at runtime
      • From: Ken Tozier <email@hidden>
    • Re: Class lookup at runtime
      • From: Rob Keniger <email@hidden>
  • Prev by Date: Re: Edit NSTokenField's token?
  • Next by Date: Re: Class lookup at runtime
  • Previous by thread: Re: Edit NSTokenField's token?
  • Next by thread: Re: Class lookup at runtime
  • Index(es):
    • Date
    • Thread