App在iOS模拟器中运行正常,在设备上崩溃。

| 我的monotouch iPhone / iPod应用程序(名为Assement)在iOS模拟器中运行良好,没有任何警告,也没有任何错误。但是,当我将其部署到设备上时,它会在启动时立即崩溃。 我看了一下崩溃转储(可以在此处下载完整的.crash文件),但它看起来甚至没有脱离Application.Main():
14  Assessment                      0x002a0ffc mono_handle_exception (mini-exceptions.c:1831)
15  Assessment                      0x002c64cc mono_arm_throw_exception (exceptions-arm.c:158)
16  Assessment                      0x00197cc4 throw_exception + 4018  CoreFoundation                   0x000a4daa __handleUncaughtException + 206
  -->  17  Assessment                       0x003fda68 monotouch_exception_handler (monotouch-glue.m:834)
  -->  18  CoreFoundation                   0x000a4daa __handleUncaughtException + 206
19  libobjc.A.dylib                 0x000088cc _objc_terminate + 148
20  libstdc++.6.dylib               0x00063100 __cxxabiv1::__terminate(void (*)()) + 76
21  libstdc++.6.dylib               0x00063178 std::terminate() + 16
22  libstdc++.6.dylib               0x000632a0 __cxa_throw + 100
23  libobjc.A.dylib                 0x00006f28 objc_exception_throw + 104
24  CoreFoundation                  0x000a4abc +[NSException raise:format:arguments:] + 64
25  CoreFoundation                  0x000a4af0 +[NSException raise:format:] + 24
26  UIKit                           0x00290af8 -[UINib instantiateWithOwner:options:] + 1724
27  UIKit                           0x00292638 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 132
28  UIKit                           0x00051b10 -[UIApplication _loadMainNibFile] + 136
29  UIKit                           0x0004b9e4 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 248
30  UIKit                           0x000052dc -[UIApplication handleEvent:withNewEvent:] + 1468
31  UIKit                           0x00004b14 -[UIApplication sendEvent:] + 60
32  UIKit                           0x000043ac _UIApplicationHandleEvent + 6816
33  GraphicsServices                0x00005c80 PurpleEventCallback + 1040
34  CoreFoundation                  0x000365c4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 22
35  CoreFoundation                  0x00036582 __CFRunLoopDoSource1 + 158
36  CoreFoundation                  0x0002882e __CFRunLoopRun + 574
37  CoreFoundation                  0x00028504 CFRunLoopRunSpecific + 220
38  CoreFoundation                  0x00028412 CFRunLoopRunInMode + 54
 --> 39  UIKit                          0x0004a54c -[UIApplication _run] + 540
 --> 40  UIKit                          0x00047550 UIApplicationMain + 964
 --> 41  Assessment                     0x00024bcc wrapper_managed_to_native_MonoTouch_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 232
 --> 42  Assessment                     0x001e9420 X2_AssessmentApp_Application_Main_string__ + 144
43  Assessment                      0x001673f8 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 192
Application.Main是创建项目时生成的标准代码(以下代码均无效,命名空间限定的注释版本具有相同的结果):
namespace XXXXXX.App //anonymized
{
public class Application
{
    static void Main (string[] args)
    {
        //UIApplication.Main(args, null, \"XXXXXX.App.AppDelegate\");
        UIApplication.Main(args, null, \"AppDelegate\");
    }
}
// The name AppDelegate is referenced in the MainWindow.xib file.
public partial class AppDelegate : UIApplicationDelegate
{
   // This method is invoked when the application has loaded its UI and its ready to run
    public override bool FinishedLaunching (UIApplication app, NSDictionary options)
    {
        System.Console.WriteLine(\"Finished Launching\"); ...
我是否可以正确假设加载主笔尖时失败?那将仅仅是MainWindow.xib,又是开箱即用的,因为我在UIApplicationDelegate.FinishedLaunching()方法中所做的第一件事是加载我自己的viewcontroller和view ...我几乎希望可以该代码中有一个错误,但还没到那么远。 环境: MonoTouch专业版3.2.6 MonoDevelop 2.4.2版本20402004 iPod Touch第二代(4.2.1) 谁有想法?     
已邀请:
戈夫(Goeff)引导我找到正确的答案。 我以某种方式将MainWindow.xib生成操作从Page更改为Content...。完全用户错误。 设备的控制台日志明确指出了问题所在(与崩溃转储不同):
<Notice>: Unhandled Exception: MonoTouch.Foundation.MonoTouchException: Objective-C exception thrown.  Name: NSInternalInconsistencyException Reason: Could not load NIB in bundle: \'NSBundle </var/mobile/Applications/11DD588C-E16C-499D-AE0C-E56F59D90391/Assessment.app> (loaded)\' with name \'MainWindow\'
    

要回复问题请先登录注册