Is there a way to #import a class from a string in Objective-C at runtime? Any methods that lead to a similar result will also be welcome.
Edit:
I need access to a class whose name I define at runtime. So something like this:
NSString *className = getClassName(); Class myClass = loadClass(className); myClass *myVar = [[myClass alloc] init];
Is there a way to do this without putting the static #import directive for myClass at the top of the file?
dynamic objective-c iphone cocoa
Jacob Lyles
source share