누수 :이상한 NSLog 오류. 난 내 응용 프로그램 출력을 실행할 때 메모리 나에게이 문자열을 많이 보여줍니다
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];
}
}
아이디어가 있으십니까? Thnx
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];
}
*/
}
여전히 메모리 누수 .. 그래서 지금 쓸 생각? NSAutoreleasePool
를 사용하는
UPD는 2
이 메서드는 백그라운드 스레드에서 호출됩니다? – rishi
@rishi 예.백그라운드에서 –