warning: Direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass()
替换
object->isa object_getClass(object)
object_setClass(id,object)
bit masking for introspection of objective-c 警告
#pragma clang diagnostic push
#pragma clang diagnostic ignored"-Wdeprecated-objc-pointer-introspection"
BOOL workAroundMacOSXABIBreakingBug = (JK_EXPECT_F(((NSUInteger)object) &0x1)) ? YES : NO;
#pragma clang diagnostic pop
其他警告 %lu 替换 %u
本文探讨了Objective-C中直接访问对象的isa属性所引发的警告,并提供了使用object_setClass和object_getClass替代的方法来避免这些警告。此外,文中还介绍了如何通过编译器指令暂时忽略这些警告。

被折叠的 条评论
为什么被折叠?



