Is there a way in objective-c/Cocoa to alloc an object when the class name isn't know until run-time. I seem to remember something about this a while ago, but can't find anything on it now.
Something like:
[[@"MyClass" alloc] init];
I seem to recall a function that would return some kind of class id based on a string that can then be used to alloc the object.
id object = [[NSClassFromString(@"MyClass") alloc] init];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With