views:

86

answers:

2

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 procedures.

+2  A: 

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.

rpetrich
A game that I have used, Hyper Warp, does this exact thing - when it runs low on memory, it saves the game, opens a URL on their website, then opens the app reloads the game.Technically, it's possible. But it was really, really irritating.
Gordon Christie
I would not knowingly purchase a game that behaved like that.
rpetrich
A: 

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.

JeremyP
2 things -- first of all, does anyone know if apple disabled execv on the device (like they do with mprotect)? Secondly, when I try this in the simulator, it 'launches' the app and definitely calls main, but for some reason shows a black screen in the simulator. Any ideas on this? I'm pretty stumped.
Jared P