Converting object_setInstanceVariable() to ARC?

£可爱£侵袭症+ 提交于 2019-12-04 13:40:44

Source: https://developer.apple.com/library/ios/#documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html

The only other method to do this is:

void object_setIvar(id object, Ivar ivar, id value);

You need the Ivar value beforehand, which can be obtained via class_getInstanceVariable(Class class, char* name).

Overall this will achieve the same effect as before, whilst now being ARC compatible.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!