【问题标题】:UIApplicationMain method crashing in iOS 10UIApplicationMain 方法在 iOS 10 中崩溃
【发布时间】:2017-05-29 17:22:58
【问题描述】:

我的应用程序在 iOS 10.3.1 设备的 UIApplicationMain 方法上以某种方式崩溃。

它表示 SIGSEGV: SEGV_ACCERR 崩溃。

这是我迄今为止记录的数据:

0   libobjc.A.dylib 0x00000001943afbd0 objc_msgSend + 12
1   CoreFoundation 0x0000000182b7bf6c ___forwarding___ + 436
2   CoreFoundation 0x0000000182a7eccc __forwarding_prep_0___ + 88
3   CoreFoundation 0x0000000182b7e100 __invoking___ + 140
4   CoreFoundation 0x0000000182a7a2fc -[NSInvocation invoke] + 292
5   WebCore 0x000000019148aefc HandleDelegateSource() + 116
6   CoreFoundation 0x0000000182b30240 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 20
7   CoreFoundation 0x0000000182b2f4e4 __CFRunLoopDoSources0 + 260
8   CoreFoundation 0x0000000182b2d594 __CFRunLoopRun + 708
9   CoreFoundation 0x0000000182a592d4 CFRunLoopRunSpecific + 392
10  GraphicsServices 0x000000018c26f6fc GSEventRunModal + 164
11  UIKit 0x000000018761efac UIApplicationMain + 1484
!   12  my_app_name 0x00000001000c9954 main (main.m:14)
13  libdyld.dylib 0x0000000194a1aa08 start + 0

这就是方法:

// If nil is specified for principalClassName, the value for NSPrincipalClass from the Info.plist is used. If there is no
// NSPrincipalClass key specified, the UIApplication class is used. The delegate class will be instantiated using init.
UIKIT_EXTERN int UIApplicationMain(int argc, char *argv[], NSString * __nullable principalClassName, NSString * __nullable delegateClassName);

我应该如何调试这种无效的内存引用错误?

【问题讨论】:

    标签: ios crash segmentation-fault ios10.3


    【解决方案1】:

    可能是由于重命名的 IBOutlet 实例变量与 XML 中包含旧名称的相应 .xib 文件不匹配造成的?

    有关 Xcode 重构缺陷的深入示例,该缺陷会导致应用在执行任何代码之前在UIApplicationMain() 中崩溃:

    IBOutlet Name Change Causing Crash at UIApplicationMain

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多