object_getIvar无法读取BOOL iVar的值 [英] object_getIvar fails to read the value of BOOL iVar

查看:370
本文介绍了object_getIvar无法读取BOOL iVar的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

object_getIvar(id object,Ivar ivar)正确读取iVArs的值,但在BOOL类型iVar上失败并崩溃。
我需要一个类的所有iVars的值。有什么方法可以解决它。

object_getIvar(id object, Ivar ivar) reads the values of iVArs properly but fails on a BOOL type iVar and crashes. I need the values of all iVars of a class.Is there any way to resolve it.

推荐答案

object_getIvar似乎返回与手册所说内容相反的实际值(不是id)。如果您使用ARC,这将在尝试保留不是对象的返回值时立即导致处理器故障。

object_getIvar seems to return the actual value (not an id) which is in opposition to what the manual says. If you are using ARC, this will cause an immediate processor fault during attempt to retain the returned value which is not an object.

object_getInstanceVariable()返回指向信息的指针但是ARC拒绝接受这个功能。

object_getInstanceVariable() returns a pointer to the information, but ARC refuses to accept the function.

这篇关于object_getIvar无法读取BOOL iVar的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆