搜尋

首頁  >  問答  >  主體

objective-c - iOS 开发,如何在程序内点击按钮杀死APP

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

巴扎黑巴扎黑2889 天前455

全部回覆(3)我來回復

  • 怪我咯

    怪我咯2017-04-17 17:57:03

    一般不會拒絕,我確實看到有這麼幹的。
    只要一行就行,並且,這不是crash,不會有crash log:

    exit(0);

    回覆
    0
  • PHP中文网

    PHP中文网2017-04-17 17:57:03

    請參閱: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/StartingStopping.html

    如果是發佈到 App Store 上的 app ,建議不要這麼做,文檔上清楚地寫明了,如果被審核人員發現的話,基本上就是被拒了:

    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.

    回覆
    0
  • 高洛峰

    高洛峰2017-04-17 17:57:03

    可能會被拒絕的,畢竟exit函數是不建議使用的,這得看心情了。如果你的這個應用程式不那麼好測試的話,那有可能不被拒絕。

    回覆
    0
  • 取消回覆