0

Fabrics クラッシュ分析または「Crashlytics」を使用すると、次のメソッド/プロパティから大量のクラッシュ (BAD_ACCESS を想定) が発生します。

lazy var managedObjectModel: NSManagedObjectModel = {
    // The managed object model for the application. This property is not optional. It is a fatal error for the application not to be able to find and load its model.
    var modelURL = NSBundle.mainBundle().URLForResource("<app_name>", withExtension: "momd")
    return NSManagedObjectModel(contentsOfURL: modelURL!)!
}()

大量とは、たった 1 日で 150 人のユーザーに対して 275 回のクラッシュを意味します。ほとんどのデバイスで問題なく動作していますが、シミュレーターで一度問題が発生し、コンテンツをリセットしてマシンを再起動すると、エラーはなくなりました。

私たちの技術サポートに電話している人々に言わなければならないよりも良い解決策があることを願っています.

生地による返品

Crashed: com.apple.main-thread
0  <app_name>                     0x100082f9c specialized AppDelegate.(persistentStoreCoordinator.getter).(closure #1) (AppDelegate.swift:314)
1  <app_name>                     0x10007e678 AppDelegate.saveContext() -> () (AppDelegate.swift:340)
2  <app_name>                     0x10007e014 @objc AppDelegate.applicationWillTerminate(UIApplication) -> () (AppDelegate.swift)
3  UIKit                          0x1949f0d48 -[UIApplication _terminateWithStatus:] + 244
4  UIKit                          0x194bef268 __102-[UIApplication _handleApplicationDeactivationWithScene:shouldForceExit:transitionContext:completion:]_block_invoke.2093 + 792
5  UIKit                          0x194bf2a18 _runAfterCACommitDeferredBlocks + 292
6  UIKit                          0x194be4ab4 _cleanUpAfterCAFlushAndRunDeferredBlocks + 528
7  UIKit                          0x194958724 _afterCACommitHandler + 132
8  CoreFoundation                 0x18e7e49a0 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
9  CoreFoundation                 0x18e7e2628 __CFRunLoopDoObservers + 372
10 CoreFoundation                 0x18e7e2a74 __CFRunLoopRun + 956
11 CoreFoundation                 0x18e712d94 CFRunLoopRunSpecific + 424
12 GraphicsServices               0x19017c074 GSEventRunModal + 100
13 UIKit                          0x1949cb130 UIApplicationMain + 208
14 <app_name>                     0x100069940 main (AppDelegate.swift:43)
15 libdyld.dylib                  0x18d72159c start + 4

他の誰かがこの問題に遭遇しましたか? 現在、Swift 3.1 に変換中の Swift 2.3 を使用しています。

この関数は、applicationWillTerminate()が呼び出されたときに呼び出されます。モデル URL はありません。

4

1 に答える 1