4

使用堆栈跟踪,unsafeMutableAddressor崩溃似乎是当它AppConstant.kShowOverlay从控制器访问时viewDidLoad()

我定义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 上。

任何指针将不胜感激。

更新:我的工作区有多个项目,所以我试图访问的访问器文件和常量文件在不同的项目中。是否有任何可能导致崩溃的项目设置不匹配?

4

0 回答 0