开发者

[XXX retainCount]==0 really represent memory released?

开发者 https://www.devze.com 2023-02-28 11:07 出处:网络
all when i use [nsmutablearray removeAllObjects] i got : [nsmutableArray retainCount]==1; then,i use [nsmutableA开发者_StackOverflow社区rray relese];

all when i use [nsmutablearray removeAllObjects] i got : [nsmutableArray retainCount]==1;

then,i use [nsmutableA开发者_StackOverflow社区rray relese]; i got [nsmutableArray retainCount]==1;

so ,i think ,is [XXX retainCount]==0 really represent memory released???


From the official docs:

Important: Typically there should be no reason to explicitly ask an object what its retain count is (see retainCount). The result is often misleading, as you may be unaware of what framework objects have retained an object in which you are interested. In debugging memory management issues, you should be concerned only with ensuring that your code adheres to the ownership rules.


retainCount can never return 0.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号