My retainCount is increasing?

后端 未结 4 1417
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-04 22:18

am trying here to build rss reader , the problem that when user finish read artical and press back the dealloc don\'t called

and i got retainCount 6 & some times 7

4条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-04 23:16

    Strange as it may seem, retainCount is not useful at all for counting your retains. Things get retained for other reasons than you calling [myObject retain] or [[MyClass alloc] init] etc.

    It's better to ignore retainCount and learn the memory management rules. retainCount will make you more confused. If you're developing only for iOS 5, it's better to forget about memory management and use ARC.

提交回复
热议问题