私はこのコードを持っており、それがアークするポートに必要がありますが、私はどのように知らない:エラーがあるarcでclass_createInstanceを置き換えるにはどうすればよいですか?
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
それを置き換える方法は?
実行時にクラスオブジェクトを作成する必要があります。
これは、class_createInstanceへのextraBytesパラメータを処理しません。 –
alloc initを使用する場合、これはまだ必要ですか? –
コードで余分なバイトが使用されている場合は、はい。そうでなければ、いいえ –