Direct access to objective-c's isa is deprecated...

installed Xcode 4.6 and now facing with new errors in an ancient code I manage.

the compiler now complains about "Direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass()" and won't build


ccessing isa has been deprecated for some time, the tools just didn't tell you this. Notably, it's been deprecated for at least as long as tagged pointers have existed in obj-c.

And yes, object_setClass() is the appropriate replacement.

That said, why do you even need this? It's extremely rare that replacing the class of an object is appropriate, and the only valid case I can think of is when you're trying to dynamically subclass a class in order to inject new behavior into individual instances without modifying the class as a whole (which is, of course, something you probably don't need to do).



http://stackoverflow.com/questions/14590637/replacing-self-isa-because-of-xcode-4-6-deprecation

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值