title: Dealing with open async web requests when UIViewController is popped (AFNetworking)
body: <p>Here's the scenario:</p>
  
  <p>-A UIViewController (A) is pushed onto the navigation stack<br>
  -On viewDidLoad an async GET is called using AFNetworking (a singleton AFHTTPClient shared throughout the application) to populate various user elements on the view (say a UILabel).<br>
  -The user presses the back button before the request returns<br>
  -Assume other active view controllers may be making requests so you can't cancel all open operations</p>
  
  <p>So question #1 is, should you track the open requests made by UIViewController A and cancel the outstanding ones when the user leaves that view, or should you let them finish up and ignore them? Since AFNetworking uses blocks, the user elements being updated are retained inside the block and therefore won't cause a crash when the success/fail block is executed after the view has been popped. However the downside to ignoring them seems to be unnecessary network traffic.</p>
  
  <p>Question #2 is, where would you execute the code to cancel the operations made by UIViewController A? viewDidDisappear doesn't seem right because the user may have gone forward (pushed a new view onto the stack) instead of back (popped the current view), in which case you don't want to cancel the open requests because the user may come back to the current view and it won't load again. However, I don't think dealloc or viewDidUnload will be called while the request is executing since the block will keep a retain on the user elements so I don't think it can go there.</p>
  
  <p>Would appreciate thoughts on this. What do you think is best practice?</p>