Is there any way to force an iPhone application to relaunch?
Basically -[UIApplication openURL:] would be perfect, if it wasn't for the fact that it doesn't work within the same application (at least on simulator -- if this works on device someone please tell me). It's not a super big deal though if it just relaunches w/o URLness since I can obviously just persist some data. The goal of this is to essentially free all memory in the application and call all of the loading procedu开发者_开发知识库res.
This is not a good idea. You should fix your memory management issues and provide a reload button if the application pulls in external data sources.
If you absolutely need to do this, you can use -[UIApplication openURL:]
to open a web page in Safari that redirects back to your application via an url scheme.
You almost certainly could do this with the C library call execv
. But like everybody else, I think it is wrong to even be thinking about it.
精彩评论