Proper way to exit iPhone application?

前端 未结 25 2688
难免孤独
难免孤独 2020-11-22 01:54

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 ca

相关标签:
25条回答
  • 2020-11-22 02:59
    [[UIApplication sharedApplication] terminateWithSuccess];
    

    It worked fine and automatically calls

    - (void)applicationWillTerminateUIApplication *)application delegate.
    

    to remove compile time warning add this code

    @interface UIApplication(MyExtras)
      - (void)terminateWithSuccess;
    @end 
    
    0 讨论(0)
提交回复
热议问题