Creating a Class Instance By Name
Creating a Class Instance By Name
- Subject: Creating a Class Instance By Name
- From: Seth Willits <email@hidden>
- Date: Tue, 7 Dec 2004 21:14:41 -0800
I need to create a class instance based on its name (as
NSDocumentController does from the Info.plist in every document-based
application) but I can't figure out the exact steps to do so. I'm
doing:
Class class = objc_getClass("MyClassName");
id instance = class_createInstance(class, 0);
But I always get "warning: initialization makes pointer from integer
without a cast" on the second line.
Reference:
id objc_getClass(const char *aClassName);
id class_createInstance(Class theClass, unsigned additionalByteCount);
-- Seth
_______________________________________________
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