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 |
相关文章推荐
- 不直接使用NSData的dataWithContentsOfURL来获取网络数据
- dataWithContentsOfURL返回nil
- (Swift报错提示)dataWithContentsOfURL
- 从相册读取大文件dataWithContentsOfURL?
- NSData dataWithContentsOfURL
- Automating the Creation of Data-Rich Business Documents with Word 2007 and Visual Basic 2005
- Automating the Creation of Data-Rich Business Documents with Word 2007 and ASP.NET
- How to use stringWithContentsOfURL:encoding:error:
- [Android] Use Jsoup to grab the web data and process the data with string.indexOf()
- stringWithContentsOfURL 编码问题
- imageNamed/ imageWithContentsOfFile /imageWithData 的区别
- iOS: NSData的方法dataWithContentsOfFile:
- 远程读取中文网页内容并显示, keyword: html, stringWithContentsOfURL encoding
- 关于stringWithContentsOfURL
- UTL_HTTP Call a Web Service and Pass Parameters as Part of the URL
- iOS: NSData的方法dataWithContentsOfFile:options:error:
- UTL_HTTP Call a Web Service and Pass Parameters as Part of the URL
- stringWithContentsOfURL:encoding:error方法返回nil
- nsdata dataWithContentsOfFile 大文件
- UTL_HTTP Call a Web Service and Pass Parameters as Part of the URL