iphonehig

Is this a valid justification for quitting an iPhone app programmatically?


I know this question has been asked many times and we have gotten this link as an answer from Apple: http://developer.apple.com/library/ios/#qa/qa1561/

However, recently, I met with this case below. I don't see any other options except using 'exit(0)' directly.

I have an app which can collect digital data from camera or microphone of my iPhone. Then I designed a button which reads 'Save and Exit', because this is a very common scenario of my app.

Without the capability to exit my app programatically, I can only have a stupid 'Save' button. Then my users have to click twice ( 1. the 'Save' button, and then 2. the 'Home' button ) to get the same result - a.k.a these two actions in sequence together.

Then I realized, maybe, this is a flaw of my design. Hence I changed it this way.

I removed the 'Save the Exit' button and, instead, added a note in the bottom says 'Use HOME button to SAVE & EXIT'. I tried to catch the quitting signal from users' action and then do the SAVE in prior.

By doing this, user can simply use the native HOME button to do the 'SAVE and EXIT'.

However, this solution is not perfect.

If my app takes too long to save the data, there's still a chance for iOS to kill my app after user hits the 'HOME' button. Then user can lost their data without notice!

If I can exit programmatically, I can try to 'SAVE' first. If 'SAVE' fails, I have plenty of time to inform my user or do all the remediation work needed.

Do you think this is a valid justification to use 'exit(0)' in my app without being rejected?


Solution

  • No, I very much doubt that Apple will let you have a "save and exit" button. It goes completely against the platform conventions and directly contradicts Apple's HIG.

    Under which circumstances do you think you'll have data that can't be saved in the amount of time iOS gives an app to clean up? Have you actually measured this and found it to be a problem?