即使我在委托方法中注释掉每一个活动,每次我调用“managedobjectcontext save:nil”操作时,应用程序都会崩溃,不同的错误如下:(看起来像是一个发布问题,但不确定在哪里。我得到了EXC_BAD_ACCESS)
#0 0x02813a93 in objc_msgSend
#1 0xbfffd5b0 in ??
#2 0x0236c1b2 in -[NSFetchedResultsController(PrivateMethods) _postprocessInsertedObjects:]
#3 0x023721bc in -[NSFetchedResultsController(PrivateMethods) _managedObjectContextDidChange:]
#4 0x00024c1d in _nsnote_callback
#5 0x02690cf9 in __CFXNotificationPost_old
#6 0x0261011a in _CFXNotificationPostNotification
#7 0x0001a7c2 in -[NSNotificationCenter postNotificationName:object:userInfo:]
#8 0x022ae519 in -[NSManagedObjectContext(_NSInternalNotificationHandling) _postObjectsDidChangeNotificationWithUserInfo:]
#9 0x0231db33 in -[NSManagedObjectContext(_NSInternalChangeProcessing) _createAndPostChangeNotification:withDeletions:withUpdates:withRefreshes:]
#10 0x02290f78 in -[NSManagedObjectContext(_NSInternalChangeProcessing) _processRecentChanges:]
#11 0x022caa15 in -[NSManagedObjectContext save:]
#12 0x00005147 in -[PostsViewController saveMOC:] at PostsViewController.m:254
#13 0x00039e9a in __NSThreadPerformPerform
#14 0x02699d7f in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
#15 0x025f81dd in __CFRunLoopDoSources0
#16 0x025f77c6 in __CFRunLoopRun
#17 0x025f7280 in CFRunLoopRunSpecific
#18 0x025f71a1 in CFRunLoopRunInMode
#19 0x02f1d2c8 in GSEventRunModal
#20 0x02f1d38d in GSEventRun
#21 0x002c8b58 in UIApplicationMain
#22 0x000028c0 in main at main.m:14
答案 0 :(得分:2)
您最有可能拥有一个在保存上下文时更改FRC的属性。如果您将某个属性用作sectionNameKeyPath
,则在保存时更改属性可能会触发此问题。