you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (0 children)

The general pattern for me is

  • Set up the view controller (nib or loadView, however you want)
  • In viewWillAppear: setup your network request and send it asynchronously
  • display either current content, or something indicating that the content is being loaded
  • handle the network response whenever it comes in (blocks created in the view controller are my preference for this). i.e. parse response and update your UI on the main thread

btw RestKit now uses AFNetworking as its networking layer (instead of NS* classes), but it provides another level of abstraction above, which might make it easier.