When to use -retainCount?

前端 未结 11 1347
借酒劲吻你
借酒劲吻你 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:01

    NEVER!

    Seriously. Just don't do it.

    Just follow the Memory Management Guidelines and only release what you alloc, new or copy (or anything you called retain upon originally).

    @bbum said it best here on SO, and in even more detail on his blog.

提交回复
热议问题