title: iOS App Crashes - I suspect it has to do with UIWebView using WebSockets
body: <p>I am not currently using applicationWillResignActive / applicationWillEnterForeground or anything similar, as I'm not sure exactly how to handle this issue I'm running into.</p>
  
  <p>My app keeps crashing if I open it up, press home screen, wait about 5 minutes, and try to go back into the app again.</p>
  
  <p>The app is mainly a UIWebView that loads a node.js powered websocket, so I think that is the culprit.</p>
  
  <p>How can I stop the UIWebView from doing anything/everything when the user leaves the app (applicationWillResignActive is what I'm guessing needs to be used). I have played with a half dozen ideas and I cannot for the life of me get the app to stop crashing.</p>
  
  <p>My Current Idea:</p>
  
  <pre><code>- (void)applicationWillResignActive:(UIApplication *)application
  {
  [[NSNotificationCenter defaulCenter] postNotificationName:@"EnterBackground" object:Nil userInfo: Nil];
  }
  </code></pre>
  
  <p>...and then from there I edit my ViewController.m file to do something to the UIWebView on that page. The problem is, what will stop the UIWebView from doing anything while in the background? I have tried stoploading, and for some reason had no success, or it would still crash.</p>