• 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
Loading classes for use with NSClassFromString, how?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Loading classes for use with NSClassFromString, how?


  • Subject: Loading classes for use with NSClassFromString, how?
  • From: Ken Tozier <email@hidden>
  • Date: Mon, 16 May 2005 09:37:32 -0400

I need to convert some stored strings to classes so that I can run one of their methods. I thought I could use NSClassFromString() like so

[NSClassFromString(@"MyClassName")
        doSomethingCool: 5
        withThisHereThing: @"bobo"];

But apparently the class isn't loaded yet as NSClassFromString() always returns nil. Is there a way to load a specific class at runtime?

Thanks

Ken
_______________________________________________
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: Loading classes for use with NSClassFromString, how?
      • From: Nicko van Someren <email@hidden>
  • Prev by Date: Re: OpenGL and Tiger
  • Next by Date: Re: Loading classes for use with NSClassFromString, how?
  • Previous by thread: Re: Document based CoreData app and global context
  • Next by thread: Re: Loading classes for use with NSClassFromString, how?
  • Index(es):
    • Date
    • Thread