从版本(没有核心数据)更新应用程序到版本(其中新增了核心数据)时崩溃

时间:2014-05-19 06:28:13

标签: ios objective-c core-data magicalrecord magicalrecord-2.2

我正在使用MagicalRecord将数据保存到数据库中。当我尝试将应用程序更新为核心数据版本时。

我第一次尝试保存一些东西时会遇到异常

[MagicalRecord saveWithBlockAndWait:^(NSManagedObjectContext *localContext) {
            MenuModel *menuModel = [CDMenuModel insertInManagedObjectContext:localContext];
            menuModel.sectionTitle = tibbrLocalizedString(@"menu_view.menuItem_mainWall.menu", @"Main Wall");
            menuModel.indexPath = [NSNumber numberWithInt:1];
        }];

请找到您的参考资料的崩溃堆栈跟踪

还要根据下面的崩溃日志告诉我你的发现

Thread 0 Crashed:
0   libobjc.A.dylib                 0x38760627 objc_msgSend + 7
1   Foundation                      0x2e8e6029 -[NSError dealloc] + 57
2   libobjc.A.dylib                 0x38765b67 objc_object::sidetable_release(bool) + 171
3   libobjc.A.dylib                 0x387660cf (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 355
4   CoreFoundation                  0x2def74bd _CFAutoreleasePoolPop + 13
5   Foundation                      0x2e8f08df -[NSAutoreleasePool drain] + 119
6   CoreData                        0x2dd37fbb -[NSManagedObjectContext save:] + 939
7   appname_test                            0x002f2f7b 0x8e000 + 2510715
8   CoreData                        0x2dd9b9cb developerSubmittedBlockToNSManagedObjectContextPerform + 87
9   CoreData                        0x2dd9bb0f -[NSManagedObjectContext performBlockAndWait:] + 111
10  appname_test                            0x002f2ecf 0x8e000 + 2510543
11  CoreData                        0x2dd9b9cb developerSubmittedBlockToNSManagedObjectContextPerform + 87
12  libdispatch.dylib               0x38c3fd3d _dispatch_client_callout + 21
13  libdispatch.dylib               0x38c446bf _dispatch_barrier_sync_f_invoke + 23
14  CoreData                        0x2dd9bb07 -[NSManagedObjectContext performBlockAndWait:] + 103
15  appname_test                            0x001807e9 0x8e000 + 993257
16  appname_test                            0x002509d1 0x8e000 + 1845713
17  appname_test                            0x0026d497 0x8e000 + 1963159
18  appname_test                            0x00265be7 0x8e000 + 1932263
19  UIKit                           0x307f7a4f -[UIViewController loadViewIfRequired] + 515
20  UIKit                           0x307f780d -[UIViewController view] + 21
21  UIKit                           0x3086ec39 -[UIClientRotationContext initWithClient:toOrientation:duration:andWindow:] + 385
22  UIKit                           0x3086d59d -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 1197
23  UIKit                           0x3086d0e3 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 43
24  UIKit                           0x3086d06b -[UIWindow _setRotatableViewOrientation:updateStatusBar:duration:force:] + 91
25  UIKit                           0x3086d003 -[UIWindow _setRotatableViewOrientation:duration:force:] + 39
26  UIKit                           0x3086567d __57-[UIWindow _updateToInterfaceOrientation:duration:force:]_block_invoke + 105
27  UIKit                           0x307f9695 -[UIWindow _updateToInterfaceOrientation:duration:force:] + 381
28  UIKit                           0x3086cd55 -[UIWindow setAutorotates:forceUpdateInterfaceOrientation:] + 693
29  UIKit                           0x3086c825 -[UIViewController _tryBecomeRootViewControllerInWindow:] + 157
30  UIKit                           0x307fe611 -[UIWindow addRootViewControllerViewIfPossible] + 457
31  UIKit                           0x307fbdd5 -[UIWindow _setHidden:forced:] + 301
32  UIKit                           0x30865a4d -[UIWindow makeKeyAndVisible] + 57
33  appname_test                            0x0037ae55 0x8e000 + 3067477
34  UIKit                           0x30862cbd -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 273
35  UIKit                           0x3086260f -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1607
36  UIKit                           0x3085ccc5 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 717
37  UIKit                           0x307f8c93 -[UIApplication handleEvent:withNewEvent:] + 3547
38  UIKit                           0x307f7df5 -[UIApplication sendEvent:] + 69
39  UIKit                           0x3085c401 _UIApplicationHandleEvent + 613
40  GraphicsServices                0x32e55b53 _PurpleEventCallback + 607
41  GraphicsServices                0x32e5573b PurpleEventCallback + 31
42  CoreFoundation                  0x2df8e845 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 33
43  CoreFoundation                  0x2df8e7df __CFRunLoopDoSource1 + 343
44  CoreFoundation                  0x2df8cfab __CFRunLoopRun + 1403
45  CoreFoundation                  0x2def7765 CFRunLoopRunSpecific + 521
46  CoreFoundation                  0x2def7547 CFRunLoopRunInMode + 103
47  UIKit                           0x3085b627 -[UIApplication _run] + 759
48  UIKit                           0x3085688d UIApplicationMain + 1133
49  appname_test                            0x0009b5cd 0x8e000 + 54733
50  libdyld.dylib                   0x38c54ab5 start + 1

0 个答案:

没有答案