As the analyzer says, you are allocating locs on line 647, using NSMutableArray *locs = [[NSMutableArray alloc] init]; and not releasing it later in the block. You should release it or you can use convenience constructor to get the autoreleased array like this, NSMutableArray *locs = [NSMutableArray array];
I'd suggest you to still simplify your code to this,
发布评论
评论(3)
正如分析器所说,您正在 647 行上分配 locs,使用
NSMutableArray *locs = [[NSMutableArray alloc] init];
并且稍后不会在块中释放它。您应该释放它,或者您可以使用方便的构造函数来获取自动释放的数组,如下所示,NSMutableArray *locs = [NSMutableArray array];
我建议您仍然简化您的对此的代码,
As the analyzer says, you are allocating locs on line 647, using
NSMutableArray *locs = [[NSMutableArray alloc] init];
and not releasing it later in the block. You should release it or you can use convenience constructor to get the autoreleased array like this,NSMutableArray *locs = [NSMutableArray array];
I'd suggest you to still simplify your code to this,
您需要在最后释放 locs。您已经分配并初始化了它,给它的引用计数为 1,然后您应该释放它以将引用计数更改为 0。请参阅 http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/MemoryMgmt/ 了解更多信息。
You need to release locs at the very end. You have alloc'ed and init'ed it, giving it a reference count of 1, an then you should release it to change the reference count to 0. Refer to http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/MemoryMgmt/ for more info.
您已经初始化了 locs 数组,然后必须在关闭该函数之前释放该数组:
[locs release];locs=nil;
You have initialize the locs array then you have to release that array before closing that function:
[locs release];locs=nil;