I have an function which gives me back a Class:
- (Class)classForMyType:(NSString *)myType;
This class is given back like this:
return [MyFirstClass class];
In the code, where I call this function, I can store the Class like this:
Class myClass = [self classForMyType:@"foo"];
How can I instantiate a variable in the type of myClass
? I want something like myClass *foo = [[myClass alloc] init]
, but this does not work.