Does removeObject release the object in an NSMutableArray of objects?

前端 未结 4 993
春和景丽
春和景丽 2021-02-16 00:29

I was wondering when you remove an object using removeObject in an array if that removed object is handled properly. Would the object being removed be released?

4条回答
  •  时光说笑
    2021-02-16 00:34

    Yes, when the object is removed from the NSMutableArray, it is released. If its retain count is 0, it will be deallocated (or garbage collected, if you were instead running on OS X with GC enabled).

提交回复
热议问题