当我运行我的应用程序输出时,我会看到很多这样的字符串:
2012-05-12 14:41:52.542 PermTour[1688:15c0b] *** __NSAutoreleaseNoPool(): Object 0x5c39520 of class NSCFString autoreleased with no pool in place - just leaking
而且我知道这部分代码中的问题。因为,当我评论它时,输出是空的。
for(int i=0;i<[dataBase.allDataBase count];i++){
aPLace = [dataBase.allDataBase objectAtIndex:i];
name = [aPLace.name lowercaseString];
description = [aPLace.description lowercaseString];
if (!([name rangeOfString:searchText].location == NSNotFound) || !([description rangeOfString:searchText].location == NSNotFound)){
[foundedPlaces addObject:aPLace];
}
}
有任何想法吗?谢谢
UPD。
当我评论所有代码时,它看起来像:
for(int i=0;i<[dataBase.allDataBase count];i++){
aPLace = [dataBase.allDataBase objectAtIndex:i];
name = [aPLace.name lowercaseString];
//description = [aPLace.description lowercaseString];
/*
if (!([name rangeOfString:searchText].location == NSNotFound) || !([description rangeOfString:searchText].location == NSNotFound)){
[foundedPlaces addObject:aPLace];
}
*/
}
仍然内存泄漏.. 那么你现在想写什么?
更新 2