I have this code and need to port it, but I do not know how:
case FIELDTYPE_OBJECT: className = [fieldType substringWithRange:NSMakeRange(2, [fieldType length]-3)]; rel = class_createInstance(NSClassFromString(className), sizeof(unsigned)); Class theClass = [rel class]; if ([rel isKindOfClass:[DbObject class]]) {
Error:
error: 'class_createInstance' is unavailable: not available in automatic reference counting mode
How to replace it?
I need to create class objects at runtime.
source share