1

How to force exit iOS application using Monotouch?When network not available I want to exit application. Thanks for your advice.

Noro
  • 1,643
  • 5
  • 22
  • 38
  • Don't do it. People don't expect that behavior, and Apple itself asks people not to do that. Instead, show and error message in your app, but leave it running. Having the app close like that will make people think the app is crashing. – Eduardo Scoz Jun 01 '11 at 12:46

2 Answers2

3

I use the following code in my app:

UIApplication.SharedApplication.PerformSelector(new Selector("terminateWithSuccess"), null, 0f);

It is not recommended by apple to use such selectors, however they did not reject my application.

madoke
  • 873
  • 11
  • 25
1

You cannot do this with native iOS coding (Objective C) so I would not expect that you can do it with anything else. Check out this question Exit application in iOS 4.0

Community
  • 1
  • 1
drekka
  • 20,957
  • 14
  • 79
  • 135