When to use -retainCount?

前端 未结 11 1518
借酒劲吻你
借酒劲吻你 2020-11-21 06:49

I would like to know in what situation did you use -retainCount so far, and eventually the problems that can happen using it.

Thanks.

11条回答
  •  温柔的废话
    2020-11-21 07:07

    Autoreleased objects are one case where checking -retainCount is uninformative and potentially misleading. The retain count tells you nothing about how many times -autorelease has been called on an object and therefore how many time it will be released when the current autorelease pool drains.

提交回复
热议问题