user21293 user21293 - 2 months ago 17
Objective-C Question

Proper way to exit iPhone application?

I am programming an iPhone app, and I need to force it to exit due to certain user actions. After cleaning up memory the app allocated, what's the appropriate method to call to terminate the application?

Answer

Have you tried exit(0)?

Alternatively, [[NSThread mainThread] exit], although I have not tried that it seems like the more appropriate solution.

Comments