iphoneobjective-cios4application-restart

Force iphone app to restart programmatically?


I am trying to get my iPhone app to restart programmatically when the Logout button is pressed.

Has anyone got a code sample to share? I've read that it is possible by modifying the main.m file but I couldn't find any code related to this.

Any help would be appreciated.


Solution

  • First of all, although it is possible to force kill your app, this is not allowed by Apple and will rejected. Even if it wasn't rejected, there is no way to restart your app once it's killed. You just need to find some way to reset your app through your code, as Jason Coco said. It might be more work, but it's worth it to not get rejected by Apple.