Search code examples
xamarin.iosterminate

How do I properly terminate a MonoTouch application?


I am using the following code, but even after I call it, my app is still in the iOS task manager (double-click on the Home button).

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

When I delete the app from the task manager (hold on app in the task manager for 2-seconds then press the red minus sign), it disappears from the task manager as it should.

If I terminate it using the code above, why is it still in the task manager? How do I programmatically kill it hard so that it disappears from the task manager?


Solution

  • Your forcing the app to close (http://support.apple.com/kb/ht5137) through the iOS interface wont remove it from the 'task manager'. The 'task manager' really shows a list of recent apps.

    Terminating an app programmatically wont remove it from the recent apps list.