I've tried using both:
NSClassFromString and objc_getclass
to return a class, so I can create it at runtime, but both functions return nil for some classes, for example "TestClass". Note that NSClassFromString works for me for 99% of classes.
If I add
[TestClass class];
before I call NSStringFromClass or objc_getclass it, it works. and if I try to just create the class using a class reference, i.e.:
[TestClass alloc];
it works too. So how can I force the class to load at runtime so NSClassFromString or objc_getclass will not return nil?