3

Possible Duplicate:
call exit(0) in iphone app

Suppose I encounter a serious error within an iPhone app -- unable to instantiate a required Core Data stack, or something of the sort. My understanding is that Apple recommends simply aborting, rather than attempting to display an error to the user that they will not be able to do anything about.

  1. Is this correct?
  2. Is abort() the recommended way to abort, or does Cocoa have something better?

The Apple iOS HIG says "alerts are usually unnecessary if they ... inform users of errors or problems about which they can do nothing."

Community
  • 1
  • 1
c roald
  • 1,984
  • 1
  • 20
  • 30
  • iOS apps that simply vanish are pretty annoying too. I would read that HIG as, "Make sure your alert tells the user something useful...even if it's just 'Contact the developer with this information: ...'." – Phillip Mills May 16 '12 at 22:57
  • Apple discourages exiting programmatically. The advice against displaying errors that users can't do anything about is really about popping up numerous annoying messages; if the app can't function at all, it should tell the user rather than simply crashing. See http://stackoverflow.com/questions/3097244/exit-application-in-ios-4-0 and http://stackoverflow.com/questions/3097244/exit-application-in-ios-4-0 for more. – Kristopher Johnson May 16 '12 at 22:58

0 Answers0