Why does NSClassFromString
return nil
? As per the definition it has to return class name.
How should I take care to rectify this problem? I need t
The Documentation for the function says:
Return Value The class object named by aClassName, or nil if no class by that name is currently loaded. If aClassName is nil, returns nil.
An example of how this should be properly used is as follows:
Class dictionaryClass = NSClassFromString(@"NSMutableDictionary");
id object = [[dictionaryClass alloc] init];
[object setObject:@"Foo" forKey:@"Bar"];