iOS Swift:iOS 8上未女性化的地址崩溃
使用堆栈跟踪,iOS Swift:iOS 8上未女性化的地址崩溃,swift,ios8,exc-bad-access,dylib,kern-invalid-address,Swift,Ios8,Exc Bad Access,Dylib,Kern Invalid Address,使用堆栈跟踪,unsafemutaledAddressor从控制器的viewDidLoad()访问AppConstant.kShowOverlay时似乎会崩溃 我定义了AppConstant.swift如下: struct AppConstant { // MARK: Properties static let kShowOverlay = false } 以下是crashlytics的堆栈跟踪: Crashed: com.apple.main-thread EXC_B
unsafemutaledAddressor
从控制器的viewDidLoad()访问AppConstant.kShowOverlay
时似乎会崩溃
我定义了AppConstant.swift
如下:
struct AppConstant {
// MARK: Properties
static let kShowOverlay = false
}
以下是crashlytics的堆栈跟踪:
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000048
0 libswiftCore.dylib 0x51bfc5c _TTWuRq_Ss9Indexable_GVSs5Sliceq__Ss14CollectionTypeSsFS1_10suffixFromuRq_S1__fq_Fqq_S_5Indexqq_S1_11SubSequence
1 MyAppModule 0x56fbad4 AppConstants.kShowOverlay.unsafeMutableAddressor (AppConstants.swift)
2 libdispatch.dylib 0x34ba9f13 dispatch_once_f + 62
3 MyApp 0x23e38e8 globalinit_33_D6508E60499748694DF7352631AEB836_func18 (MyViewController.swift:73)
4 libdispatch.dylib 0x34ba92cf _dispatch_client_callout + 22
5 libdispatch.dylib 0x34ba9f13 dispatch_once_f + 62
6 MyApp 0x2383e88 MyViewController.setupCollectionView(MyViewController) -> () -> () (MyViewController.swift:530)
7 MyApp 0x29f0a3c MyViewController.viewDidLoad(MyViewController) -> () -> () (MyViewController.swift:59)
我无法重新编程此崩溃,只能从crashlytics获取堆栈跟踪
是否有人有任何想法,比如,原因是什么,或者我应该如何尝试重新解释这次崩溃
注意:崩溃只发生在iOS 8上。
如有任何提示,将不胜感激。
更新:我的工作区有多个项目,因此我尝试访问的访问者文件和常量文件位于不同的项目中。是否有可能导致崩溃,如项目设置不匹配?我也遇到过这种崩溃。适用于iPhone 5和iOS10.3.1
。似乎只有在不同的设备+iOS版本上才会崩溃。因为代码在不同的设备上执行不到100次。但只有一台设备必须在这一点上崩溃。