Re: Creating a Class Instance By Name
Re: Creating a Class Instance By Name
- Subject: Re: Creating a Class Instance By Name
- From: Chris Hanson <email@hidden>
- Date: Wed, 8 Dec 2004 01:05:05 -0800
On Dec 7, 2004, at 9:14 PM, Seth Willits wrote:
Class class = objc_getClass("MyClassName");
id instance = class_createInstance(class, 0);
Check out NSClassFromString. Also note that classes can be messaged
just like instances, so you can just send the result +alloc.
-- Chris
_______________________________________________
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