删除后ARC可可中的观察者 [英] Removing observers in post-ARC Cocoa

查看:156
本文介绍了删除后ARC可可中的观察者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,我一直在dealloc中删除观察者(通知或KVO)。因为dealloc在ARC中已经消失了,那么推荐的方法是什么呢?

So far I have been removing observers (notifications or KVO) in the dealloc. Since dealloc is gone in ARC, what's the recommended way to do this?

推荐答案

ivar释放和超级调用方面是自动处理,允许你省略它,如果这是所有你要做的,但你仍然应该实现其他的事情,如果这是有意义的。

-dealloc is not gone under ARC. The ivar-releasing and super-calling aspects are handled automatically, allowing you to omit it if that's all you were going to do, but you should still implement it for other things if it makes sense to do so.

这篇关于删除后ARC可可中的观察者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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