Quote:
Originally Posted by carbonbasednerd
So, you are running the app on a device and that app is started in xcode. While it's running you force quit the app via the device and then tap the icon on the iphone to open it again?
If you are then i don't think anything is wrong. What's going on is that you are killing the session on the iphone but the session hasn't terminated in xcode and you are trying to open another session on the iphone. Not the most technical explanation - but if that's what you are doing then i don't think there is anything wrong.
|
Exactly. But in my case, I was trying to start my app using Safari to trigger the app's Custom URL Scheme. For those readers who might stumble across the same situation as mine, here's the sequence:
- I start the app via Xcode in the simulator.
- I tap the simulator's home button to put my app in background.
- I start Safari and send "myappname://" just to see if it, in fact, brings my app to the foreground. It does.
- Now I want to make sure it kicks off the app while it is terminated, so I double-tap home and kill the app. Important note: Xcode is still running the simulation.
- I return to Safari and send the URL again. The app displays as expected in the simulator but immediately crashes with a SIGKILL error.
I twisted my brain for awhile trying to figure out what was wrong with the code. Turns out, nothing is wrong with the code. To "fix", simply stop the simulation in Xcode as carbonbasednerd explained:
- Stop the Xcode simulation (click "Stop").
- Double-tap the simulator Home button and kill the app again (because it was restarted by Safari even though the app crashed.)
- Return to Safari and send the URL.
- Ta da! The app does a cold start and calls my app delegate's openURL: method, as advertised by Apple.