NSArray sortedArrayUsingSelector内存泄漏 [英] NSArray sortedArrayUsingSelector memory leak
本文介绍了NSArray sortedArrayUsingSelector内存泄漏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我收到包含sortedArrayUsingSelector定义的行的内存泄漏.有人知道这可能是什么问题吗?
I receive a memory leak for the line containing the sortedArrayUsingSelector definition. Does anybody know what might be the problem?
@property (nonatomic, retain) NSArray *indexLetters;
...
NSMutableDictionary *indexedCategories = [[NSMutableDictionary alloc] init];
...
self.indexLetters = [[indexedCategories allKeys] sortedArrayUsingSelector:@selector(compare:)];
[indexedCategories release];
推荐答案
可能是因为您没有在dealloc
中释放indexLetters
变量.
It could be because you're not releasing the indexLetters
variable in dealloc
.
这篇关于NSArray sortedArrayUsingSelector内存泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文