Call Exit(0) in iPhone App

iOS is exit(0) deprecated?

I got an app which was rejected because of a way of exit (via UIAlertView), doing an exit(5) when user click on the correct button.

I received that:

We found that your app includes a UI control for quitting the app.
This is not in compliance with the iOS Human Interface Guidelines, as
required by the App Store Review Guidelines.

Please refer to the attached screenshot/s for reference.

The iOS Human Interface Guidelines specify,

"Always Be Prepared to Stop iOS applications stop when people press
the Home button to open a different application or use a device
feature, such as the phone. In particular, people don’t tap an
application close button or select Quit from a menu. To provide a good
stopping experience, an iOS application should:

  • Save user data as soon as possible and as often as reasonable because an exit or terminate notification can arrive at any time.

  • Save the current state when stopping, at the finest level of detail possible so that people don’t lose their context when they start the
    application again. For example, if your app displays scrolling data,
    save the current scroll position."


It would be appropriate to remove any mechanisms for quitting your
app.

A "hidden" exit could be understood as a crash for the user, no?

iOS is exit(0) Reject

Do not provide buttons or options for exiting from your application.

If you do so apple will reject your application.

Also if you call exit(0) from your application at certain point, apple will take it as a crash.

So never do it, your app will be rejected.

Can I Use the Exit(0) function on IOS when i have no Internet Connection and pass Appstore Test

No, you must not call exit. Your app will be rejected. This has been repeatedly discouraged by Apple and is known to cause serious bugs with iOS multitask switching. You should simply leave the user to use the home button themselves.

iOS exit(0) strange behavior

This is exactly the problem with exit(0). You get weird multitasking behaviour and all sorts of other problems.

You simply can't terminate your application in code. You should explain to us why you think you need to quit programmatically so we can help you find an alternative solution.

(iOS) Exit the app programmatically.

As @BJHStudios said, it is against Apple guidelines to force an app to close programmatically. As a user, it would also be an unwelcome feature.

As an example, if I opened your app and didn't have an internet connection, I might simply need to turn on wifi or disable airplane mode. It would be better in my opinion to be told there is no connection and be presented with a retry option so I could perhaps fix my connection without getting bumped back to the home screen.

Something like an infinite retry option is what many game makers use for online only games, and it doesn't cause any problems on submission.

Just food for thought.

How to properly quit application, call exit(0)?

Use NSApplication's terminate method. For example:

[NSApp terminate:self]

Documentation is available here.

Proper way to exit iPhone application?

Have you tried exit(0)?

Alternatively, [[NSThread mainThread] exit], although I have not tried that it seems like the more appropriate solution.



Related Topics



Leave a reply



Submit