Deprecate on ->isa

After update to XCode 4.6(?), the place using

NSObject->isa

will raise a deprecated warning, we can change by

(int)object_getClass(handlerDelegate)

 

_delegateIsa = (int)NSClassFromString([[delegate_ class] description]);

//************************************************************************************

BTW, ARC weak has resolve the delegate release problem.

//************************************************************************************

 

//the following micro works also to remove the compile warning.

 

#pragma clang diagnostic push

#pragma clang diagnostic ignored "-Wdeprecated-objc-isa-usage"

    array->isa      = _JKArrayClass;

#pragma clang diagnostic pop

 

#pragma clang diagnostic push

#pragma clang diagnostic ignored "-Wdeprecated-declarations"

    deviceId = [UIDevice currentDevice].uniqueIdentifier;

#pragma clang diagnostic pop  

猜你喜欢

转载自shappy1978.iteye.com/blog/1833176
isa
今日推荐