Let’s say my app does something unrecoverable (this never happens, right? 😛 ). Should I use exit()? Should I use NSAssert(false, @”Foo”)? Should I throw something somehow? Hard answer to google for.
Let’s say my app does something unrecoverable (this never happens, right? :P ). Should
Share
I don’t think you should force quit your app if something bad happens as it is annoying for the user – they won’t have a clue about what went wrong. Also, Apple are likely to reject your app if this is a common enough occurrence.
Instead you should pop up a dialog to say what went wrong (eg error writing to database, please try again).
If your app can end up in a state where it is totally broken, you should re-design your app. Could you give an example of something “unrecoverable”?