// This is the main entry point of the application. private static void Main(string[] args) { try { NSSetUncaughtExceptionHandler( Marshal.GetFunctionPointerForDelegate(new NSUncaughtExceptionHandler(MyUncaughtExceptionHandler))); // if you want to use a different Application Delegate class from "AppDelegate" // you can specify it here. UIApplication.Main(args, null, "AppDelegate"); } catch (Exception e) { AppDelegate.HandleException(e.ToString()); throw; } }
private static void MyUncaughtExceptionHandler(IntPtr exception) { var e = new NSException(exception); AppDelegate.HandleException(e.ToString()); }