I am trying to build something to dynamically instantiate an object from class-name similar to how Java's Class.forName method works, e.g.
Class klass = Class.forName("MyClass");
Object obj = klass.instantiate(...
I didn't see any such behavior in Objective-C so I would like to call a method to register Class when an Objective-C class is loaded. Basically, I would like to call a method that registers my class, e.g.
+ (void)mystatic {
[NSKeyedUnarchiver setClass:[self class] forClassName:"MyClass"]
}
Is there a way to do this in Objective-C on OS X platform?
Thanks.