Using pointers in Objective C for NSMutableArray objects

前端 未结 3 895
春和景丽
春和景丽 2021-01-03 16:48

When retrieving objects from an NSMutableArray in cocoa-touch is the below code ok? Should I be allocating([alloc]) new Page objects each time or is just pointing to it alri

3条回答
  •  温柔的废话
    2021-01-03 17:33

    Of course not. You have allocated it before and are just referencing the same object. No need to reallocate. Also you don't need to set it to nil.

提交回复
热议问题