2

我正在开发一个以时事通讯样式界面为中心的 iPad 应用程序。我正在使用 Apple 的 UIPageViewController 来执行此操作。

我遇到了很多我不完全理解的错误,我希望有人可以帮助我找到解决方案。

在此界面中翻页时,应用程序偶尔会冻结(这就是它如此令人沮丧的原因,因为它不容易复制)。我在调试器中暂停了应用程序,这就是它向我显示的内容http://cl.ly/image/1y3c2x351t0T

我很清楚这是一个与核心数据相关的错误。之前在执行获取请求时发生过。我以为我解决了它,但它不断返回。

- (void)setupBlockViews{
//Setup the block views in the correct order

NSMutableArray *blockViewsInUse = [[[NSMutableArray alloc] init] autorelease];
for(NLNewsletterPageBlock *pageBlock in self.page.pageBlocks){
    NLNewsletterPageBlockView *blockView = [self blockViewForBlock:pageBlock];
    if(blockView){
        blockView.parentPageVC = self;
        [blockViewsInUse addObject:blockView];
    }
}

//recycle block views if needed
if(RECYCLE_BLOCK_VIEWS){
    NSMutableArray *oldBlockViews = [[[NSMutableArray alloc] init] autorelease];
    for(NLNewsletterPageBlockView *blockView in self.blockViews){
        if(![blockViewsInUse containsObject:blockView]){
            [oldBlockViews addObject:blockView];
        }
    }

    for(NLNewsletterPageBlockView *blockView in oldBlockViews){
        [blockView prepareForReuse];
    }
    [self.recycledBlockViews addObjectsFromArray:oldBlockViews];
}

self.blockViews = blockViewsInUse;

[self layoutBlockViews];
}

上面的方法 setupBlockViews 在 UIPageViewController 委托方法 pageViewController:(UIPageViewController *)pageViewController spinLocationForInterfaceOrientation:(UIInterfaceOrientation)orientation 中被调用。

在此特定实例中,尝试访问 NSManagedObject 的已获取属性时会发生错误。即self.page.pageBlocks

我多次确保我遵循线程、核心数据和托管对象上下文的所有规则,所以我认为它与线程和核心数据无关。

任何人都可以理解这一点吗?这里会发生什么?

谢谢。

这是堆栈跟踪:

 
* 线程 #1:tid = 0x1c03,0x99d7691a libsystem_kernel.dylib`__psynch_mutexwait + 10,停止原因 = 信号 SIGSTOP
    帧#0:0x99d7691a libsystem_kernel.dylib`__psynch_mutexwait + 10
    帧 #1:0x9a0f919b libsystem_c.dylib`pthread_mutex_lock + 595
    帧#2:0x013efb01 CoreData`-[_PFLock lock] + 33
    帧#3:0x013efada CoreData`-[NSPersistentStoreCoordinator lock] + 42
    帧#4:0x0140457e CoreData`-[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 1182
    帧 #5: 0x014029c9 CoreData`-[NSManagedObjectContext executeFetchRequest:error:] + 569
    帧 #6: 0x0145ddfa CoreData`-[NSFaultHandler reservedFulfillAggregateFaultForObject:andRelationship:withContext:] + 298
    帧 #7:0x0148b5cf CoreData`-[_NSFaultingMutableArray willRead] + 143
    帧 #8: 0x0148baf3 CoreData`-[_NSFaultingMutableArray countByEnumeratingWithState:objects:count:] + 35
    帧 #9: 0x0000858c iNewsletter`-[NLNewsletterPageViewController setupBlockViews](self=0x1282ff30, _cmd=0x002e1491) + 206 at NLNewsletterPageViewController.m:408
    框架 #10: 0x00007724 iNewsletter`-[NLNewsletterPageViewController updateLowFootprint](self=0x1282ff30, _cmd=0x002e0ad7) + 62 at NLNewsletterPageViewController.m:253
    帧 #11: 0x0000495b iNewsletter`-[NLNewsletterViewController pageForIndex:](, _cmd=0x002e09cc) + 884 at NLNewsletterViewController.m:392
    帧 #12: 0x00009fc2 iNewsletter`-[NLNewsletterVC_AppleStyle goToPage:animated:](, _cmd=0x002e0afd) + 209 at NLNewsletterVC_AppleStyle.m:163
    帧 #13: 0x00006781 iNewsletter`-[NLNewsletterViewController thumbnailPVRecievedTouch:withEvent:](, _cmd=0x002e0949, sender=0x128bb9d0) + 667 at NLNewsletterViewController.m:779
    帧 #14:0x02aac705 libobjc.A.dylib`-[NSObject performSelector:withObject:withObject:] + 77
    帧 #15: 0x019e3920 UIKit`-[UIApplication sendAction:to:from:forEvent:] + 96
    帧 #16: 0x019e38b8 UIKit`-[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
    帧 #17: 0x01aa4671 UIKit`-[UIControl sendAction:to:forEvent:] + 66
    帧 #18: 0x01aa4bcf UIKit`-[UIControl(Internal) _sendActionsForEvents:withEvent:] + 578
    第 19 帧:0x01aa3d38 UIKit`-[UIControl touchesEnded:withEvent:] + 546
    帧 #20: 0x01a1333f UIKit`-[UIWindow _sendTouchesForEvent:] + 846
    帧 #21: 0x01a13552 UIKit`-[UIWindow sendEvent:] + 273
    帧 #22: 0x019f13aa UIKit`-[UIApplication sendEvent:] + 436
    帧 #23:0x019e2cf8 UIKit`_UIApplicationHandleEvent + 9874
    帧 #24:0x03472df9 图形服务`_PurpleEventCallback + 339
    帧 #25:0x03472ad0 GraphicsServices`PurpleEventCallback + 46
    帧 #26:0x00c80bf5 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
    帧 #27: 0x00c80962 CoreFoundation`__CFRunLoopDoSource1 + 146
    帧 #28: 0x00cb1bb6 CoreFoundation`__CFRunLoopRun + 2118
    帧 #29:0x00cb0f44 CoreFoundation`CFRunLoopRunSpecific + 276
    帧#30:0x00cb0e1b CoreFoundation`CFRunLoopRunInMode + 123
    帧 #31:0x034717e3 图形服务`GSEventRunModal + 88
    帧 #32:0x03471668 GraphicsServices`GSEventRun + 104
    帧 #33: 0x019e065c UIKit`UIApplicationMain + 1211
    帧 #34: 0x00002385 iNewsletter`main(argc=1, argv=0xbffff390) + 83 at main.m:16

  线程#3:tid = 0x2203, 0x99d779ca libsystem_kernel.dylib`kevent64 + 10
    帧#0:0x99d779ca libsystem_kernel.dylib`kevent64 + 10
    帧#1:0x02d3fc2b libdispatch.dylib`_dispatch_mgr_invoke + 863
    帧#2:0x02d3f8cc libdispatch.dylib`_dispatch_mgr_thread + 61

  线程#5:tid = 0x2403, 0x99d747d2 libsystem_kernel.dylib`mach_msg_trap + 10
    帧#0:0x99d747d2 libsystem_kernel.dylib`mach_msg_trap + 10
    帧#1:0x99d73cb0 libsystem_kernel.dylib`mach_msg + 68
    帧#2:0x00caca49 CoreFoundation`__CFRunLoopServiceMachPort + 185
    帧#3:0x00cb18d4 CoreFoundation`__CFRunLoopRun + 1380
    帧#4:0x00cb0f44 CoreFoundation`CFRunLoopRunSpecific + 276
    帧#5:0x00cb0e1b CoreFoundation`CFRunLoopRunInMode + 123
    帧 #6: 0x06c67310 WebCore`RunWebThread(void*) + 608
    帧 #7:0x9a0f35b7 libsystem_c.dylib`_pthread_start + 344

  线程#6:tid = 0x2503, 0x99d747d2 libsystem_kernel.dylib`mach_msg_trap + 10
    帧#0:0x99d747d2 libsystem_kernel.dylib`mach_msg_trap + 10
    帧#1:0x99d73cb0 libsystem_kernel.dylib`mach_msg + 68
    帧#2:0x00caca49 CoreFoundation`__CFRunLoopServiceMachPort + 185
    帧#3:0x00cb18d4 CoreFoundation`__CFRunLoopRun + 1380
    帧#4:0x00cb0f44 CoreFoundation`CFRunLoopRunSpecific + 276
    帧#5:0x00cb0e1b CoreFoundation`CFRunLoopRunInMode + 123
    帧 #6: 0x0259bebe Foundation`+[NSURLConnection(Loader) _resourceLoadLoop:] + 393
    帧#7:0x024e40d5 Foundation`-[NSThread main] + 76
    第 8 帧:0x024e4034 基础`__NSThread__main__ + 1304
    帧 #9:0x9a0f35b7 libsystem_c.dylib`_pthread_start + 344

  线程#9:tid = 0x2803, 0x99d7691a libsystem_kernel.dylib`__psynch_mutexwait + 10
    帧#0:0x99d7691a libsystem_kernel.dylib`__psynch_mutexwait + 10
    帧 #1:0x9a0f919b libsystem_c.dylib`pthread_mutex_lock + 595
    帧#2:0x013efb01 CoreData`-[_PFLock lock] + 33
    帧#3:0x013efada CoreData`-[NSPersistentStoreCoordinator lock] + 42
    帧 #4: 0x014040cc CoreData`-[NSManagedObjectContext(_NSInternalAdditions) lockObjectStore] + 76
    帧#5:0x0146164a CoreData`-[NSManagedObjectContext(_NSInternalAdditions)_dispose:] + 490
    帧#6:0x014611c5 CoreData`-[NSManagedObjectContext _dealloc__] + 325
    帧 #7: 0x01461077 CoreData`-[NSManagedObjectContext dealloc] + 103
    帧 #8: 0x0006927e iNewsletter`-[RHManagedObjectContext dealloc](self=0x0b04c880, _cmd=0x02d4dabe) + 176 at RHManagedObjectContextManager.m:53
    帧#9:0x014262f1 CoreData`-[NSManagedObjectContext release] + 81
    帧 #10:0x00c8741c CoreFoundation`CFRelease + 108
    帧 #11: 0x00d8ed1e CoreFoundation`-[__NSDictionaryM dealloc] + 158
    帧 #12: 0x02aac9ff libobjc.A.dylib`-[NSObject release] + 47
    第 13 帧:0x0248ddcd 基础`__NSFinalizeThreadData + 1295
    帧 #14:0x00cbf5e2 CoreFoundation`__CFTSDFinalize + 98
    帧 #15:0x9a0fa9c7 libsystem_c.dylib`_pthread_tsd_cleanup + 206
    帧 #16:0x9a0f380f libsystem_c.dylib`_pthread_exit + 145
    帧 #17:0x9a0f60b5 libsystem_c.dylib`_pthread_workq_return + 54
    帧 #18:0x9a0f5e79 libsystem_c.dylib`_pthread_wqthread + 448

  线程 #13:tid = 0x2c03、0x99d76be6 libsystem_kernel.dylib`select$DARWIN_EXTSN + 10
    帧#0:0x99d76be6 libsystem_kernel.dylib`select$DARWIN_EXTSN + 10
    帧#1:0x00ceecb7 CoreFoundation`__CFSocketManager + 1255
    帧 #2:0x9a0f35b7 libsystem_c.dylib`_pthread_start + 344

  线程 #15:tid = 0x2e03,0x99d768e2 libsystem_kernel.dylib`__psynch_cvwait + 10
    帧#0:0x99d768e2 libsystem_kernel.dylib`__psynch_cvwait + 10
    帧#1:0x9a0f8280 libsystem_c.dylib`_pthread_cond_wait + 833
    帧#2:0x9a17e0e0 libsystem_c.dylib`pthread_cond_timedwait$UNIX2003 + 70
    帧 #3: 0x07fcc82b JavaScriptCore`WTF::ThreadCondition::timedWait(WTF::Mutex&, double) + 123
    帧 #4: 0x07fa0bd9 JavaScriptCore`JSC::BlockAllocator::blockFreeingThreadMain() + 121
    帧 #5:0x07fcbb8c JavaScriptCore`WTF::threadEntryPoint(void*) + 76
    帧 #6: 0x07fcc0e5 JavaScriptCore`WTF::wtfThreadEntryPoint(void*) + 21
    帧 #7:0x9a0f35b7 libsystem_c.dylib`_pthread_start + 344

  线程 #16: tid = 0x2f03, 0x99d768e2 libsystem_kernel.dylib`__psynch_cvwait + 10
    帧#0:0x99d768e2 libsystem_kernel.dylib`__psynch_cvwait + 10
    帧#1:0x9a0f8280 libsystem_c.dylib`_pthread_cond_wait + 833
    帧 #2:0x9a17e095 libsystem_c.dylib`pthread_cond_wait$UNIX2003 + 71
    帧 #3: 0x07ed0ad7 JavaScriptCore`JSC::SlotVisitor::drainFromShared(JSC::SlotVisitor::SharedDrainMode) + 439
    帧 #4: 0x07ed085a ​​JavaScriptCore`JSC::MarkStackThreadSharedData::markingThreadMain() + 234
    帧 #5:0x07fcbb8c JavaScriptCore`WTF::threadEntryPoint(void*) + 76
    帧 #6: 0x07fcc0e5 JavaScriptCore`WTF::wtfThreadEntryPoint(void*) + 21
    帧 #7:0x9a0f35b7 libsystem_c.dylib`_pthread_start + 344

  线程 #17: tid = 0x3003, 0x99d770ee libsystem_kernel.dylib`__workq_kernreturn + 10
    帧#0:0x99d770ee libsystem_kernel.dylib`__workq_kernreturn + 10
    帧#1:0x9a0f60ac libsystem_c.dylib`_pthread_workq_return + 45
    帧#2:0x9a0f5e79 libsystem_c.dylib`_pthread_wqthread + 448

  线程 #19:tid = 0x3203, 0x99d770ee libsystem_kernel.dylib`__workq_kernreturn + 10
    帧#0:0x99d770ee libsystem_kernel.dylib`__workq_kernreturn + 10
    帧#1:0x9a0f60ac libsystem_c.dylib`_pthread_workq_return + 45
    帧#2:0x9a0f5e79 libsystem_c.dylib`_pthread_wqthread + 448

  线程 #21: tid = 0x3403, 0x99d770ee libsystem_kernel.dylib`__workq_kernreturn + 10
    帧#0:0x99d770ee libsystem_kernel.dylib`__workq_kernreturn + 10
    帧#1:0x9a0f60ac libsystem_c.dylib`_pthread_workq_return + 45
    帧#2:0x9a0f5e79 libsystem_c.dylib`_pthread_wqthread + 448

  线程 #22: tid = 0x3503, 0x99d7691a libsystem_kernel.dylib`__psynch_mutexwait + 10
    帧#0:0x99d7691a libsystem_kernel.dylib`__psynch_mutexwait + 10
    帧 #1:0x9a0f919b libsystem_c.dylib`pthread_mutex_lock + 595
    帧#2:0x013efb01 CoreData`-[_PFLock lock] + 33
    帧#3:0x013efada CoreData`-[NSPersistentStoreCoordinator lock] + 42
    帧 #4: 0x014040cc CoreData`-[NSManagedObjectContext(_NSInternalAdditions) lockObjectStore] + 76
    帧#5:0x014219c2 CoreData`_PFFaultHandlerLookupRow + 306
    帧 #6: 0x01421887 CoreData`-[NSFaultHandler fullyFault:withContext:forIndex:] + 39
    帧#7:0x014214c1 CoreData`_PF_FulfillDeferredFault + 225
    帧#8:0x01421336 CoreData`_sharedIMPL_pvfk_core + 70
    帧#9:0x014521a0 CoreData`_pvfk_3 + 32
    帧 #10: 0x000063ab iNewsletter`-[NLNewsletterViewController thumbnailPickerView:imageAtIndex:](, _cmd=0x002e0f16, thumbnailPickerView=0x128bb9d0) + 239 at NLNewsletterViewController.m:723
    帧 #11: 0x000515c5 iNewsletter`__33-[ThumbnailPickerView reloadData]_block_invoke119(.block_descriptor=0x128c2fc0) + 81 at ThumbnailPickerView.m:230
    帧 #12:0x02d3a53f libdispatch.dylib`_dispatch_call_block_and_release + 15
    帧 #13:0x02d4c014 libdispatch.dylib`_dispatch_client_callout + 14
    帧 #14:0x02d3c418 libdispatch.dylib`_dispatch_queue_drain + 239
    帧 #15:0x02d3c2a6 libdispatch.dylib`_dispatch_queue_invoke + 59
    帧 #16:0x02d3d280 libdispatch.dylib`_dispatch_root_queue_drain + 231
    帧 #17:0x02d3d450 libdispatch.dylib`_dispatch_worker_thread2 + 39
    帧 #18:0x9a0f5e72 libsystem_c.dylib`_pthread_wqthread + 441

  线程 #14: tid = 0x2d03, 0x99d770ee libsystem_kernel.dylib`__workq_kernreturn + 10
    帧#0:0x99d770ee libsystem_kernel.dylib`__workq_kernreturn + 10
    帧#1:0x9a0f60ac libsystem_c.dylib`_pthread_workq_return + 45
    帧#2:0x9a0f5e79 libsystem_c.dylib`_pthread_wqthread + 448

  线程 #24:tid = 0x3703, 0x99d747d2 libsystem_kernel.dylib`mach_msg_trap + 10
    帧#0:0x99d747d2 libsystem_kernel.dylib`mach_msg_trap + 10
    帧#1:0x99d73cb0 libsystem_kernel.dylib`mach_msg + 68
    帧#2:0x00caca49 CoreFoundation`__CFRunLoopServiceMachPort + 185
    帧#3:0x00cb18d4 CoreFoundation`__CFRunLoopRun + 1380
    帧#4:0x00cb0f44 CoreFoundation`CFRunLoopRunSpecific + 276
    帧#5:0x00cb0e1b CoreFoundation`CFRunLoopRunInMode + 123
    帧 #6: 0x068340b0 WebCore`WebCore::runLoaderThread(void*) + 208
    帧 #7: 0x07fcbb8c JavaScriptCore`WTF::threadEntryPoint(void*) + 76
    帧 #8: 0x07fcc0e5 JavaScriptCore`WTF::wtfThreadEntryPoint(void*) + 21
    帧 #9:0x9a0f35b7 libsystem_c.dylib`_pthread_start + 344

下一次发生的另一个堆栈跟踪:

线程 #1: tid = 0x1c03, 0x99d7691a libsystem_kernel.dylib`__psynch_mutexwait + 10, 停止原因 = 信号 SIGSTOP
    帧#0:0x99d7691a libsystem_kernel.dylib`__psynch_mutexwait + 10
    帧 #1:0x9a0f919b libsystem_c.dylib`pthread_mutex_lock + 595
    帧#2:0x013efb01 CoreData`-[_PFLock lock] + 33
    帧#3:0x013efada CoreData`-[NSPersistentStoreCoordinator lock] + 42
    帧 #4: 0x014040cc CoreData`-[NSManagedObjectContext(_NSInternalAdditions) lockObjectStore] + 76
    帧#5:0x014219c2 CoreData`_PFFaultHandlerLookupRow + 306
    帧 #6: 0x01421887 CoreData`-[NSFaultHandler fullyFault:withContext:forIndex:] + 39
    帧#7:0x014214c1 CoreData`_PF_FulfillDeferredFault + 225
    帧#8:0x01421336 CoreData`_sharedIMPL_pvfk_core + 70
    帧#9:0x014521d0 CoreData`_pvfk_4 + 32
    帧 #10: 0x00016617 iNewsletter`-[NLNewsletter isReady](self=0x0b058010, _cmd=0x02679b09) + 53 at NLNewsletter.m:175
    帧 #11: 0x0002f7f8 iNewsletter`-[NLNewsletterContainerVC displayNewsletter](self=0x10bbe700, _cmd=0x002e4ea8) + 174 at NLNewsletterContainerVC.m:156
    帧 #12: 0x0002f743 iNewsletter`-[NLNewsletterContainerVC viewDidFinishPresenting](self=0x10bbe700, _cmd=0x002e1d74) + 79 at NLNewsletterContainerVC.m:145
    帧 #13: 0x02aac663 libobjc.A.dylib`-[NSObject performSelector:] + 62
    帧 #14: 0x0000b2f2 iNewsletter`__43-[NLStandarVC presentVC:fromView:animated:]_block_invoke(.block_descriptor=0x10b07830) + 289 at NLStandarVC.m:142
    帧 #15: 0x0000b499 iNewsletter`__43-[NLStandarVC presentVC:fromView:animated:]_block_invoke105(, finished='\x01') + 24 at NLStandarVC.m:159
    第 16 帧:0x01a2b446 UIKit`-[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 223
    第 17 帧:0x01a1e3b6 UIKit`-[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 237
    第 18 帧:0x01a1e554 UIKit`-[UIViewAnimationState animationDidStop:finished:] + 68
    帧 #19: 0x018f67d8 QuartzCore`CA::Layer::run_animation_callbacks(void*) + 284
    帧 #20:0x02d4c014 libdispatch.dylib`_dispatch_client_callout + 14
    帧 #21:0x02d3c7d5 libdispatch.dylib`_dispatch_main_queue_callback_4CF + 296
    帧 #22:0x00cb1af5 CoreFoundation`__CFRunLoopRun + 1925
    帧 #23:0x00cb0f44 CoreFoundation`CFRunLoopRunSpecific + 276
    帧 #24: 0x00cb0e1b CoreFoundation`CFRunLoopRunInMode + 123
    帧 #25:0x034717e3 图形服务`GSEventRunModal + 88
    帧 #26:0x03471668 GraphicsServices`GSEventRun + 104
    帧 #27:0x019e065c UIKit`UIApplicationMain + 1211
    帧 #28: 0x00002385 iNewsletter`main(argc=1, argv=0xbffff390) + 83 at main.m:16

  线程#3:tid = 0x2203, 0x99d779ca libsystem_kernel.dylib`kevent64 + 10
    帧#0:0x99d779ca libsystem_kernel.dylib`kevent64 + 10
    帧#1:0x02d3fc2b libdispatch.dylib`_dispatch_mgr_invoke + 863
    帧#2:0x02d3f8cc libdispatch.dylib`_dispatch_mgr_thread + 61

  线程#5:tid = 0x2403, 0x99d747d2 libsystem_kernel.dylib`mach_msg_trap + 10
    帧#0:0x99d747d2 libsystem_kernel.dylib`mach_msg_trap + 10
    帧#1:0x99d73cb0 libsystem_kernel.dylib`mach_msg + 68
    帧#2:0x00caca49 CoreFoundation`__CFRunLoopServiceMachPort + 185
    帧#3:0x00cb18d4 CoreFoundation`__CFRunLoopRun + 1380
    帧#4:0x00cb0f44 CoreFoundation`CFRunLoopRunSpecific + 276
    帧#5:0x00cb0e1b CoreFoundation`CFRunLoopRunInMode + 123
    帧 #6: 0x06c67310 WebCore`RunWebThread(void*) + 608
    帧 #7:0x9a0f35b7 libsystem_c.dylib`_pthread_start + 344

  线程 #7:tid = 0x2603, 0x99d747d2 libsystem_kernel.dylib`mach_msg_trap + 10
    帧#0:0x99d747d2 libsystem_kernel.dylib`mach_msg_trap + 10
    帧#1:0x99d73cb0 libsystem_kernel.dylib`mach_msg + 68
    帧#2:0x00caca49 CoreFoundation`__CFRunLoopServiceMachPort + 185
    帧#3:0x00cb18d4 CoreFoundation`__CFRunLoopRun + 1380
    帧#4:0x00cb0f44 CoreFoundation`CFRunLoopRunSpecific + 276
    帧#5:0x00cb0e1b CoreFoundation`CFRunLoopRunInMode + 123
    帧 #6: 0x0259bebe Foundation`+[NSURLConnection(Loader) _resourceLoadLoop:] + 393
    帧#7:0x024e40d5 Foundation`-[NSThread main] + 76
    第 8 帧:0x024e4034 基础`__NSThread__main__ + 1304
    帧 #9:0x9a0f35b7 libsystem_c.dylib`_pthread_start + 344

  线程#9:tid = 0x2803, 0x99d7691a libsystem_kernel.dylib`__psynch_mutexwait + 10
    帧#0:0x99d7691a libsystem_kernel.dylib`__psynch_mutexwait + 10
    帧 #1:0x9a0f919b libsystem_c.dylib`pthread_mutex_lock + 595
    帧#2:0x013efb01 CoreData`-[_PFLock lock] + 33
    帧#3:0x013efada CoreData`-[NSPersistentStoreCoordinator lock] + 42
    帧 #4: 0x014040cc CoreData`-[NSManagedObjectContext(_NSInternalAdditions) lockObjectStore] + 76
    帧#5:0x0146164a CoreData`-[NSManagedObjectContext(_NSInternalAdditions)_dispose:] + 490
    帧#6:0x014611c5 CoreData`-[NSManagedObjectContext _dealloc__] + 325
    帧 #7: 0x01461077 CoreData`-[NSManagedObjectContext dealloc] + 103
    帧 #8: 0x0006927e iNewsletter`-[RHManagedObjectContext dealloc](self=0x10b14960, _cmd=0x02d4dabe) + 176 at RHManagedObjectContextManager.m:53
    帧#9:0x014262f1 CoreData`-[NSManagedObjectContext release] + 81
    帧 #10:0x00c8741c CoreFoundation`CFRelease + 108
    帧 #11: 0x00d8ed1e CoreFoundation`-[__NSDictionaryM dealloc] + 158
    帧 #12: 0x02aac9ff libobjc.A.dylib`-[NSObject release] + 47
    第 13 帧:0x0248ddcd 基础`__NSFinalizeThreadData + 1295
    帧 #14:0x00cbf5e2 CoreFoundation`__CFTSDFinalize + 98
    帧 #15:0x9a0fa9c7 libsystem_c.dylib`_pthread_tsd_cleanup + 206
    帧 #16:0x9a0f380f libsystem_c.dylib`_pthread_exit + 145
    帧 #17:0x9a0f60b5 libsystem_c.dylib`_pthread_workq_return + 54
    帧 #18:0x9a0f5e79 libsystem_c.dylib`_pthread_wqthread + 448

  线程 #13:tid = 0x2c03、0x99d76be6 libsystem_kernel.dylib`select$DARWIN_EXTSN + 10
    帧#0:0x99d76be6 libsystem_kernel.dylib`select$DARWIN_EXTSN + 10
    帧#1:0x00ceecb7 CoreFoundation`__CFSocketManager + 1255
    帧 #2:0x9a0f35b7 libsystem_c.dylib`_pthread_start + 344

* 线程 #15:tid = 0x2e03, 0x99d768e2 libsystem_kernel.dylib`__psynch_cvwait + 10
    帧#0:0x99d768e2 libsystem_kernel.dylib`__psynch_cvwait + 10
    帧#1:0x9a0f8280 libsystem_c.dylib`_pthread_cond_wait + 833
    帧#2:0x9a17e0e0 libsystem_c.dylib`pthread_cond_timedwait$UNIX2003 + 70
    帧 #3: 0x07fcc82b JavaScriptCore`WTF::ThreadCondition::timedWait(WTF::Mutex&, double) + 123
    帧 #4: 0x07fa0bd9 JavaScriptCore`JSC::BlockAllocator::blockFreeingThreadMain() + 121
    帧 #5:0x07fcbb8c JavaScriptCore`WTF::threadEntryPoint(void*) + 76
    帧 #6: 0x07fcc0e5 JavaScriptCore`WTF::wtfThreadEntryPoint(void*) + 21
    帧 #7:0x9a0f35b7 libsystem_c.dylib`_pthread_start + 344

  线程 #16: tid = 0x2f03, 0x99d768e2 libsystem_kernel.dylib`__psynch_cvwait + 10
    帧#0:0x99d768e2 libsystem_kernel.dylib`__psynch_cvwait + 10
    帧#1:0x9a0f8280 libsystem_c.dylib`_pthread_cond_wait + 833
    帧 #2:0x9a17e095 libsystem_c.dylib`pthread_cond_wait$UNIX2003 + 71
    帧 #3: 0x07ed0ad7 JavaScriptCore`JSC::SlotVisitor::drainFromShared(JSC::SlotVisitor::SharedDrainMode) + 439
    帧 #4: 0x07ed085a ​​JavaScriptCore`JSC::MarkStackThreadSharedData::markingThreadMain() + 234
    帧 #5:0x07fcbb8c JavaScriptCore`WTF::threadEntryPoint(void*) + 76
    帧 #6: 0x07fcc0e5 JavaScriptCore`WTF::wtfThreadEntryPoint(void*) + 21
    帧 #7:0x9a0f35b7 libsystem_c.dylib`_pthread_start + 344

  线程 #17:tid = 0x3003, 0x99d747d2 libsystem_kernel.dylib`mach_msg_trap + 10
    帧#0:0x99d747d2 libsystem_kernel.dylib`mach_msg_trap + 10
    帧#1:0x99d73cb0 libsystem_kernel.dylib`mach_msg + 68
    帧#2:0x00caca49 CoreFoundation`__CFRunLoopServiceMachPort + 185
    帧#3:0x00cb18d4 CoreFoundation`__CFRunLoopRun + 1380
    帧#4:0x00cb0f44 CoreFoundation`CFRunLoopRunSpecific + 276
    帧#5:0x00cb0e1b CoreFoundation`CFRunLoopRunInMode + 123
    帧 #6: 0x068340b0 WebCore`WebCore::runLoaderThread(void*) + 208
    帧 #7: 0x07fcbb8c JavaScriptCore`WTF::threadEntryPoint(void*) + 76
    帧 #8: 0x07fcc0e5 JavaScriptCore`WTF::wtfThreadEntryPoint(void*) + 21
    帧 #9:0x9a0f35b7 libsystem_c.dylib`_pthread_start + 344
4

1 回答 1

3

我发现一段代码在后台线程上运行,该线程正在访问在主线程上创建的 NSManagedObject。我之前错过了。互斥错误现在消失了。

于 2013-08-27T09:04:00.650 回答