iPhone memory management (with specific examples/questions)

前端 未结 3 1858
醉梦人生
醉梦人生 2020-12-20 00:58

Hey all. I know this question\'s been asked but I still don\'t have a clear picture of memory management in Objective-C. I feel like I have a pretty good grasp of it, but I\

3条回答
  •  一生所求
    2020-12-20 01:42

    First of all, with this line:

    fooArray = [[NSMutableArray alloc] init];
    

    fooArray will automatically have a retain count of 1.

    Second, yes, it's 2. And your guess on the setter implementation is correct.

    Third, the latter one is right

提交回复
热议问题