开发者

Can an iphone app shut itself down programmatically

开发者 https://www.devze.com 2022-12-29 03:37 出处:网络
I want the user to start the app 开发者_Python百科and leave it running. At one point, the app will finish what it is doing and will shut itself down.

I want the user to start the app 开发者_Python百科and leave it running. At one point, the app will finish what it is doing and will shut itself down.

How can I do that in Objective-C?


This is possible by using method:

exit(0);

However, be warned that Human Interface Guideliness discourage the use of this function, as it looks as if the application had crashed. The good solution for such a usecase is to prompt user that the application has finished working, and that he may close it now.

Hope this helps, Paul


Thanks Paul. I found another thread at Proper way to exit iPhone application? Perhaps Apple doesnt like applications committing suicide ;)

0

精彩评论

暂无评论...
验证码 换一张
取 消