With an NSArray of object references, do I explicitly release all objects in the array or just the array itself?

前端 未结 3 551
故里飘歌
故里飘歌 2020-12-08 04:26

My class has an NSArray that is filled with objects. In my dealloc method, can I simply call release on my NSArray, or do I need to iterate the array and release all object

3条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-08 04:32

    You can call release directly on the NSArray. The implementation of NSArray will take care of sending release to all the objects stored in the array.

提交回复
热议问题