• 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: Basic runtime function usage - objc_getClass
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Basic runtime function usage - objc_getClass


  • Subject: Re: Basic runtime function usage - objc_getClass
  • From: Damien Bobillot <email@hidden>
  • Date: Wed, 23 Nov 2005 21:13:50 +0100

Dan Messing wrote :

Just a remark. The dedicated Cocoa function to do this is
NSClassFromString :
Class MyClass = NSClassFromString(@"MyClass");

However, you may also use objc_getClass, but it's not the Cocoa way
to do it.

Or, if you want to let the compiler catch misspellings of "MyClass", you could just use [MyClass class] - the even more Cocoa way to do it.

Of course, but it's not possible when using plugins : in the host application, you only know the name of the class at runtime, not at compile time.


--
Damien Bobillot

_______________________________________________
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


References: 
 >Re: Basic runtime function usage - objc_getClass (From: Dan Messing <email@hidden>)

  • Prev by Date: Re: Reverse value transformation with different class?
  • Next by Date: Re: Hiding method names in binary
  • Previous by thread: Re: Basic runtime function usage - objc_getClass
  • Next by thread: Using NSInvocation with a class method
  • Index(es):
    • Date
    • Thread