如何在monotouch / ios中捕获所有崩溃异常? [英] How can I catch all crash exception in monotouch/ios?

查看:87
本文介绍了如何在monotouch / ios中捕获所有崩溃异常?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将日志代码包装在main.cs中以捕获异常,但是由monotouch构建的应用程序通常在iPad中崩溃,并且我找不到任何日志。 (某些代码包含多线程操作和wcf服务)

I have wrapped log code in main.cs to catch the exception, but the app build by monotouch usually crash in iPad, and I cannot found any log. (some code contain multithread operation and wcf service)

如何捕获所有崩溃异常?

How can I catch all crash exception?

public class Application
{
    // This is the main entry point of the application.
    static void Main (string[] args)
    {
        // if you want to use a different Application Delegate class from "AppDelegate"
        // you can specify it here.
        try
        {
            UIApplication.Main (args, null, "AppDelegate");
        }
        catch (Exception ex)
        {
            Util.LogException("Main",ex);
        }
    }
}


推荐答案

无法将本机崩溃转换为托管异常(进程的状态无效,因此无法安全继续)。

Native crashes can't be turned into managed exceptions (the state of the process is invalid, so there is no way to continue safely).


  • 崩溃报告。
  • 两种类型的信息将帮助您(或帮助其他人帮助您)了解发生了什么情况。 >
  • 设备日志。

  • The crash report.
  • The device log.

您可以在Xcode的Organizer中找到崩溃报告,然后设备登录MonoDevelop的iOS设备日志板。 此处是更详细的说明如何查找每个。

You can find the crash report in Xcode's Organizer, and the device log in MonoDevelop's iOS Device Log pad. Here is a more detailed description how to find each.

这篇关于如何在monotouch / ios中捕获所有崩溃异常?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆