objective-c - iOS 开发,如何在程序内点击按钮杀死APP
巴扎黑
巴扎黑 2017-04-17 17:55:03
0
3
441

特殊需求,需要在APP内点击一个按钮,杀死APP。求实现方法,并且请问,这种功能,会被会有被Apple store拒绝的危险

巴扎黑
巴扎黑

reply all(3)
刘奇

Normally I won’t refuse, I did see someone doing this.
Just one line is enough, and this is not a crash, there will be no crash log:

exit(0);
Ty80

See: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/StartingStopping.html

If it is an app published on the App Store, it is recommended not to do this. The document clearly states that if it is discovered by the reviewer, it will basically be rejected:

Always Be Prepared to Stop

An iOS app never displays a Close or Quit option. People stop using an app when they switch to another app, return to the Home screen, or put their devices in sleep mode.

Never quit an iOS app programmatically. People tend to interpret this as a crash. If something prevents your app from functioning as intended, you need to tell users about the situation and explain what they can do about it.
小葫芦

It may be rejected. After all, the exit function is not recommended. It depends on your mood. If your application is not easy to test, it may not be rejected.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template