iOS Download & Parsing Large JSON responses is causing CFData (store) leaks

微笑、不失礼 提交于 2019-12-01 14:32:53

I use the native JSON conversion functions with massive amounts of data with no memory problems.

I just use a standard NSURLConnection to download the NSData then do the following...

NSData *data = [NSURLConnection sendSynchronous...

// use NSDictionary or NSArray here
NSArray *array = [NSJSONSerialization JSONObjectWithData:data ...

Now deal with the objects.

No leaks as it's a native function. A lot quicker than third parts frameworks.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!