JSON을 구문 분석하려고 할 때 많은 경우 메모리 누수가 발생합니다. 그 SBJsonParser 말하고 생각, 그게 원인이되지 않을 알아요. . 나는이 문제를 해결하기 위해해야 할 일은JSON 구문 분석시 메모리 누수,
"id result=[JSON valueForKeyPath:@"result"]; "
// 100.0% memory leak
id repr = [jsonParser objectWithString:self]; // 80.0% Memory Leak
에서 일어나고
- (id)JSONValue {
SBJsonParser *jsonParser = [SBJsonParser new];
id repr = [jsonParser objectWithString:self]; // 100.0 % Memory Leak
if (!repr)
NSLog(@"-JSONValue failed. Error is: %@", jsonParser.error);
[jsonParser release];
return repr;
}
또한 메모리 누수가> :(감사
는
입니다 ARC 아래에 코드가 있습니까? – HepaKKes
누출 가능성이 가장 높습니다 (누출이 전혀없는 경우). 파서 자체 또는 파서에 의해 리턴 된 객체 –