For an unknown reason, when I kill my app in the recent menu and try to launch it again, the last screen where I was appear again and the device is frozen. What I have to do is a hard reboot and after that, launching the app again work...
Alternatively, if I want to relaunch my app after the kill in recent without a reboot, I have to type this command in mobile Terminal
killall myapp
and after this, if I try to launch my app from homescreen, my app is working correctly...
What I wanted to know is how could I detect when the user exit the app with the home button and thereby launch an NSTask that send killall command ? I know NSTask is not allowed by Apple but this is a jailbreak app that is not intended to be published on Apple Store.
Also this bug really bored me... in viewDidLoad I've several NSTask and method that check if directory exist. Do you think that these things can disallow the app from being relaunched after a kill in recent and freeze the device ? Or this is because the app run as root and there is somethings to do especially from allow the device to relaunch the app in this situation ?
Thanks in advance for your help !