您的位置:首页 > 理论基础 > 计算机网络

dataWithContentsOfURL and HTTP 302 redirects

2012-11-16 09:48 363 查看
Never use [NSData dataWithContentsOfURL:] in a real app. It makes a synchronous network connection and your app will be killed by the OS if that doesn't finish quickly enough.
Stick to NSURLConnectionDataDelegate or use [NSURLConnection sendAsynchronousRequest:queue:completionHandler:.

I ended up using [NSURLConnection sendAsynchronousRequest:queue:completionHandler:]. I've discovered multi-threading now. For the record, NSURLConnection does
handle 302s properly. –


link:http://stackoverflow.com/questions/9584663/datawithcontentsofurl-and-http-302-redirects
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: