开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜