我正在使用JSON framework (SBJson)作为我的应用。
解析值的方式
NSDictionary *results = [responseString JSONValue] ;对于第一次在控制器中使用此代码进行解析没有问题。当我再次调用同一个控制器时,它显示了数千个内存泄漏。
我去了很多论坛,但都是徒劳无功。有人能告诉我我哪里出问题了吗?
完整代码:
NSString *response = [[NSString alloc] initWithData:webData encoding:NSUTF8StringEncoding];
//NSDictionary *results =[[response JSONValue] retain] ;
if (results) {
[results release];
results=nil;
}
results =[[response JSONValue] retain] ;
[response release];提前感谢
你好,萨蒂什

发布于 2011-03-14 18:38:29
在第二次解析对象之前尝试释放该对象。
[results release];
results = nil;https://stackoverflow.com/questions/5297392
复制相似问题