nickkjordan / wruw-iphone-app

iPhone app for WRUW 91.1 Cleveland, OH http://www.wruw.org/
1 stars 2 forks source link

Switch All HTML Parsing to Asynchronously Grab Data #3

Closed nickkjordan closed 10 years ago

nickkjordan commented 10 years ago

Currently using dataWithContentsOfURL to grab HTML data from input URLs. This command will block until all the data has been returned, as described here (under 'Sit on Your Arse and Parse'):

http://www.raywenderlich.com/14172/how-to-parse-html-on-ios

Switching to particular views, like the PlaylistTVC and ArchiveTVC, render the application unresponsive for a few seconds.

As described in the resource, NSURLConnection can be used to asynchronously grab the data and avoid blocking segue to the a VC.

nickkjordan commented 10 years ago

Alternatively, this article discusses the benefits of NSURLSession over NSURLConnection, both are groups of independent classes that work to asynchronously grab data. NSURLSession is new foundation to iOS 7 and OSX 10.9 Mavericks.

http://www.objc.io/issue-5/from-nsurlconnection-to-nsurlsession.html

nickkjordan commented 10 years ago

I believe this is accomplished for the time being. Optimization can come later and would reopen if that is the case.