title: Why does my iPhone app crash after re-opening it?
body: <p>I created an iPhone app with XCode and Phonegap.</p>
  
  <p>Launching the app works perfectly fine but when I press the home button of the iPhone (which puts the app into the background) and then open the app again (to bring it to foreground), it crashes.</p>
  
  <p>This is what the logs say:</p>
  
  <blockquote>
    <p>2012-10-31 14:37:21.359 [810:907] -[AppDelegate myFunc]: unrecognized
    selector sent to instance 0x1e064220</p>
    
    <p>2012-10-31 14:37:21.361 [810:907] --- Terminating app due to uncaught
    exception 'NSInvalidArgumentException', reason: '-[AppDelegate
    myFunc]: unrecognized selector sent to instance 0x1e064220'</p>
    
    <p>--- First throw call stack:</p>
    
    <p>(0x361b62a3 0x344c697f 0x361b9e07 0x361b8531 0x3610ff68 0x36107037
    0x33bc9d91 0x37630213 0x3762fdff 0x37487d61 0x374876d5 0x37487123
    0x3663a5a3 0x3618b683 0x3618aee9 0x36189cb7 0x360fcebd 0x360fcd49
    0x366392eb 0x374db301 0xe7c89 0xe7c20)</p>
    
    <p>libc++abi.dylib: terminate called throwing an exception</p>
  </blockquote>
  
  <p>The image attached shows the line of code where it stops. <img src="https://i.stack.imgur.com/pGFuC.jpg" alt="enter image description here"></p>
  
  <p>What's going on?</p>