【问题标题】:App crashed on ipad simulator 4.3 only应用程序仅在 ipad 模拟器 4.3 上崩溃
【发布时间】:2011-12-26 17:52:19
【问题描述】:

您好,我的应用程序仅在 iPad 模拟器 4.3 上崩溃。该应用程序在 iPad 模拟器 5.0、iPhone 模拟器 4.3 和 iPhone 模拟器 5.0 中运行良好。知道可能是什么原因造成的吗? 以下是错误:

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "HomeViewController" nib but the view outlet was not set.'

0   CoreFoundation                      0x0130b5a9 __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x0145f313 objc_exception_throw + 44
    2   CoreFoundation                      0x012c3ef8 +[NSException raise:format:arguments:] + 136
    3   CoreFoundation                      0x012c3e6a +[NSException raise:format:] + 58
    4   UIKit                               0x0060f709 -[UIViewController _loadViewFromNibNamed:bundle:] + 295
    5   UIKit                               0x0060d134 -[UIViewController loadView] + 120
    6   UIKit                               0x0060d00e -[UIViewController view] + 56
    7   UIKit                               0x0060b7f5 -[UIViewController nextResponder] + 34
    8   UIKit                               0x0062c4a6 -[UIResponder _containsResponder:] + 41
    9   UIKit                               0x00616c4e -[UINavigationController defaultFirstResponder] + 80
    10  UIKit                               0x0062b647 -[UIResponder(Internal) _deepestDefaultFirstResponder] + 42
    11  UIKit                               0x0062b663 -[UIResponder(Internal) _deepestDefaultFirstResponder] + 70
    12  UIKit                               0x0062b406 -[UIResponder(Internal) _promoteDeepestDefaultFirstResponder] + 42
    13  sightwords                          0x00001ddb -[sightwordsAppDelegate application:didFinishLaunchingWithOptions:] + 395
    14  UIKit                               0x0055dc89 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1163
    15  UIKit                               0x0055fd88 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 439
    16  UIKit                               0x0056a617 -[UIApplication handleEvent:withNewEvent:] + 1533
    17  UIKit                               0x00562abf -[UIApplication sendEvent:] + 71
    18  UIKit                               0x00567f2e _UIApplicationHandleEvent + 7576
    19  GraphicsServices                    0x017e5992 PurpleEventCallback + 1550
    20  CoreFoundation                      0x012ec944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
    21  CoreFoundation                      0x0124ccf7 __CFRunLoopDoSource1 + 215
    22  CoreFoundation                      0x01249f83 __CFRunLoopRun + 979
    23  CoreFoundation                      0x01249840 CFRunLoopRunSpecific + 208
    24  CoreFoundation                      0x01249761 CFRunLoopRunInMode + 97
    25  UIKit                               0x0055f7d2 -[UIApplication _run] + 623
    26  UIKit                               0x0056bc93 UIApplicationMain + 1160
    27  sightwords                          0x00001c19 main + 121
    28  sightwords                          0x00001b95 start + 53

【问题讨论】:

    标签: iphone ios crash ios4 ios-simulator


    【解决方案1】:

    事实证明,这个错误只发生在 ipad 4.3 模拟器中。实际上 ipad 4.3 设备运行良好。

    【讨论】:

      【解决方案2】:

      在您的 nib 中,您需要将 File Owner 类设置为 HomeViewController,然后将顶层视图连接到 File Owner 的 view 插座。

      【讨论】:

      • 如果我没有设置文件所有者的类,那不会让它在 iPad 模拟器 5.o 和 iPhone 模拟器 4.3 和 5.0 上崩溃吗?
      • 我刚查了一下,肯定设置好了。
      • 显然不行,如果我的建议有效的话... 通常你会有单独的 iPhone 和 iPad 笔尖。也许你在 iPhone nib 中做得很好,也许 UIViewController 在 iOS 5 中更聪明。或者我的建议可能不正确。
      • 当你说它设置时,你是指文件所有者类,还是文件所有者视图出口,或两者兼而有之?在 iPad 笔尖中?
      • 我只有 1 个笔尖。我没有单独的 iPad 版。
      猜你喜欢
      • 2023-03-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多