-1

Any of you knows how can I quick my app. I'm trying quick my app when I app is detecting is in a bad state. Any of you knows knows how can I implement this?

I'll really appreciated all your help.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
HelenaM
  • 1,807
  • 6
  • 30
  • 41

2 Answers2

3

Throw an exception. That should terminate your app pretty quickly.

Caveat: Your program should not allow for a bad state. Throw an exception in your debug build, but once you find a situation that causes it FIX IT. This is a process that many developers are sadly not familiar with called "debugging."

borrrden
  • 33,256
  • 8
  • 74
  • 109
0

If you call exit(0) in the middle of your app, it will clos automatically. However, Apple might reject your app from the App Store because it will seem like your app has crashed instead of purposely quitting.

yliu1021
  • 94
  • 5