CoreData& RestKit崩溃:'ALL或ANY运算符的左侧必须是NSArray或NSSet。

时间:2014-10-15 09:41:09

标签: ios objective-c core-data nsmanagedobjectcontext restkit-0.20

我正面临一个与CoreData相关的奇怪崩溃。

我正在使用RestKit2,它在mainMOC和persistentMOC之间具有父子关系。 似乎导致崩溃(但几乎不可重现)的是将新实体存储到CoreData中(使用mainMOC),然后尝试检索与先前存储的实体有关系的对象(再次使用主MOC)。

堆栈跟踪不包含任何来自我的代码的指示。在合并这两种情况时似乎有些可疑。 iOS7和iOS8以及设备和模拟器都会发生崩溃。

有人有这方面的经验吗?

2014-10-15 11:25:56.208 MyApplication[77240:14758953] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'The left hand side for an ALL or ANY operator must be either an NSArray or an NSSet.'
*** First throw call stack:
(
    0   CoreFoundation                      0x04e97df6 __exceptionPreprocess + 182
    1   libobjc.A.dylib                     0x04b21a97 objc_exception_throw + 44
    2   Foundation                          0x04179816 -[NSEqualityPredicateOperator performPrimitiveOperationUsingObject:andObject:] + 0
    3   Foundation                          0x04178b05 -[NSComparisonPredicate evaluateWithObject:substitutionVariables:] + 345
    4   Foundation                          0x0426e387 -[NSSubqueryExpression expressionValueWithObject:context:] + 627
    5   Foundation                          0x04178c8c -[NSFunctionExpression expressionValueWithObject:context:] + 231
    6   Foundation                          0x04178aa2 -[NSComparisonPredicate evaluateWithObject:substitutionVariables:] + 246
    7   Foundation                          0x041a9776 -[NSCompoundPredicateOperator evaluatePredicates:withObject:substitutionVariables:] + 254
    8   Foundation                          0x041a95ec -[NSCompoundPredicate evaluateWithObject:substitutionVariables:] + 292
    9   Foundation                          0x041a9776 -[NSCompoundPredicateOperator evaluatePredicates:withObject:substitutionVariables:] + 254
    10  Foundation                          0x041a95ec -[NSCompoundPredicate evaluateWithObject:substitutionVariables:] + 292
    11  Foundation                          0x041789a4 -[NSPredicate evaluateWithObject:] + 48
    12  CoreData                            0x048d836d -[NSFetchedResultsController(PrivateMethods) _objectInResults:] + 109
    13  CoreData                            0x048d9d10 -[NSFetchedResultsController(PrivateMethods) _preprocessUpdatedObjects:insertsInfo:deletesInfo:updatesInfo:sectionsWithDeletes:newSectionNames:treatAsRefreshes:] + 672
    14  CoreData                            0x048db28a __77-[NSFetchedResultsController(PrivateMethods) _managedObjectContextDidChange:]_block_invoke + 1946
    15  CoreData                            0x047e8454 developerSubmittedBlockToNSManagedObjectContextPerform + 196
    16  CoreData                            0x047e8337 -[NSManagedObjectContext performBlockAndWait:] + 231
    17  CoreData                            0x048daacf -[NSFetchedResultsController(PrivateMethods) _managedObjectContextDidChange:] + 127
    18  Foundation                          0x0411b929 __57-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke + 40
    19  CoreFoundation                      0x04e62974 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
    20  CoreFoundation                      0x04d5061b _CFXNotificationPost + 3051
    21  Foundation                          0x0410af26 -[NSNotificationCenter postNotificationName:object:userInfo:] + 98
    22  CoreData                            0x047c94d3 -[NSManagedObjectContext(_NSInternalNotificationHandling) _postObjectsDidChangeNotificationWithUserInfo:] + 83
    23  CoreData                            0x0486954f -[NSManagedObjectContext(_NSInternalChangeProcessing) _createAndPostChangeNotification:withDeletions:withUpdates:withRefreshes:] + 367
    24  CoreData                            0x047c4d78 -[NSManagedObjectContext(_NSInternalChangeProcessing) _postRefreshedObjectsNotificationAndClearList] + 136
    25  CoreData                            0x047c483b -[NSManagedObjectContext(_NSInternalChangeProcessing) _processRecentChanges:] + 4875
    26  CoreData                            0x047c3516 -[NSManagedObjectContext processPendingChanges] + 54
    27  CoreData                            0x047969d7 _performRunLoopAction + 327
    28  CoreFoundation                      0x04dbafbe __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
    29  CoreFoundation                      0x04dbaf00 __CFRunLoopDoObservers + 400
    30  CoreFoundation                      0x04db093a __CFRunLoopRun + 1226
    31  CoreFoundation                      0x04db01ab CFRunLoopRunSpecific + 443
    32  CoreFoundation                      0x04daffdb CFRunLoopRunInMode + 123
    33  GraphicsServices                    0x05e4224f GSEventRunModal + 192
    34  GraphicsServices                    0x05e4208c GSEventRun + 104
    35  UIKit                               0x02f56e16 UIApplicationMain + 1526
    36  MyApplication                       0x000a9e04 main + 164
    37  libdyld.dylib                       0x06483ac9 start + 1
)

0 个答案:

没有答案