Как я могу заменить class_createInstance в arc?

У меня есть этот код, и мне нужно перенести его на arc, но я не знаю как:

        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]]) {
                //Load the record...
                NSInteger Id = [rs intForColumn:[theClass relationName]];
                if (Id==0) {
                    fieldValue = [rel init];
                } else {                    
                    Db *db = [Db currentDb];

                    fieldValue = [db loadById: theClass theId:Id];
                }
            }
            break;

Ошибка:

error: 'class_createInstance' is unavailable: not available in automatic reference counting mode

Как его заменить?

Мне нужно построить объекты класса во время выполнения.

6
задан Bill the Lizard 28 November 2011 в 20:36
поделиться