0
target_locations[ 0] = [[CLLocation alloc] initWithLatitude : 51.50373056
longitude : 0.129986111];
[target_locations[ 0] release];
考虑上面的代码,它是保持指定对象的保留计数为1的正确方法吗?NSMutableArray保留计数
*假设ARC未激活。
答案取决于'target_locations'是什么类型(尽管你不应该将'release'发送给数组中的对象)。 'NSArray'还是纯C数组? – 2012-03-27 18:49:24
想* owhnership *,而不是*保留计数*。或者,如果你必须,不要让@ bbum知道。 – 2012-03-27 18:54:20
target_locations是一个NSArray,希望bbum会发表评论... :) – Stanley 2012-03-27 19:01:28