以下代码将警告指示为
Direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass()
代码
if(object->isa == encodeState->fastClassLookup.stringClass)
{ isClass = JKClassString; }
else if(object->isa == encodeState->fastClassLookup.numberClass)
{ isClass = JKClassNumber; }
else if(object->isa == encodeState->fastClassLookup.dictionaryClass)
{ isClass = JKClassDictionary; }
else if(object->isa == encodeState->fastClassLookup.arrayClass)
{ isClass = JKClassArray; }
else if(object->isa == encodeState->fastClassLookup.nullClass)
{ isClass = JKClassNull; }
else
{
if([object isKindOfClass:[NSString class]])
{ encodeState->fastClassLookup.stringClass = object->isa; isClass = JKClassString; }
else if([object isKindOfClass:[NSNumber class]]) { encodeState->fastClassLookup.numberClass = object->isa; isClass = JKClassNumber; }
else if([object isKindOfClass:[NSDictionary class]]) { encodeState->fastClassLookup.dictionaryClass = object->isa; isClass = JKClassDictionary; }
else if([object isKindOfClass:[NSArray class]]) { encodeState->fastClassLookup.arrayClass = object->isa; isClass = JKClassArray; }
else if([object isKindOfClass:[NSNull class]]) { encodeState->fastClassLookup.nullClass = object->isa; isClass = JKClassNull; }
我应该做什么改变来清除那个警告?请帮帮我。