I am getting this error and i am not able to figure out, where the heck is it going on.
Here is the stack trace:
0 CoreFoundation 0x382952a3 __exceptionPreprocess + 163
1 libobjc.A.dylib 0x3358d97f objc_exception_throw + 31
2 CoreData 0x398fe0cf -[NSComparisonPredicate(_NSCoreDataSQLPredicateCategories) minimalFormInContext:] + 371
3 CoreData 0x399097af -[NSCompoundPredicateOperator(_NSCoreDataSQLPredicateCategories) minimalFormInContext:ofPredicates:] + 727
4 CoreData 0x398fd917 -[NSSQLGenerator initializeContextForFetchRequest:ignoreInheritance:nestingLevel:] + 539
5 CoreData 0x398fd3b3 -[NSSQLGenerator newSQLStatementForFetchRequest:ignoreInheritance:countOnly:nestingLevel:] + 39
6 CoreData 0x398fd2bd -[NSSQLAdapter _newSelectStatementWithFetchRequest:ignoreInheritance:] + 509
7 CoreData 0x398fced5 -[NSSQLCore newRowsForFetchPlan:] + 117
8 CoreData 0x398fc64f -[NSSQLCore objectsForFetchRequest:inContext:] + 683
9 CoreData 0x398fc119 -[NSSQLCore executeRequest:withContext:error:] + 469
10 CoreData 0x398fb531 -[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 1645
11 CoreData 0x398f9e2b -[NSManagedObjectContext executeFetchRequest:error:] + 647
12 CoreData 0x3996293f -[NSManagedObjectContext(_NestedContextSupport) _parentObjectsForFetchRequest:inContext:error:] + 399
13 CoreData 0x399630c9 __82-[NSManagedObjectContext(_NestedContextSupport) executeRequest:withContext:error:]_block_invoke_0 + 565
14 libdispatch.dylib 0x36eb2621 _dispatch_barrier_sync_f_slow_invoke + 81
15 libdispatch.dylib 0x36ea34b7 _dispatch_client_callout + 23
16 libdispatch.dylib 0x36ea4dcb _dispatch_main_queue_callback_4CF$VARIANT$up + 227
17 CoreFoundation 0x38268f3b __CFRunLoopRun + 1291
18 CoreFoundation 0x381dbebd CFRunLoopRunSpecific + 357
19 CoreFoundation 0x381dbd49 CFRunLoopRunInMode + 105
20 GraphicsServices 0x36f532eb GSEventRunModal + 75
21 UIKit 0x3a3882f9 UIApplicationMain + 1121
22 Sticky Free 0x000ac67b _mh_execute_header + 13947
23 Sticky Free 0x000ab1e0 _mh_execute_header + 8672
And here is the main error.
Invalid predicate: nil RHS
I know its from NSPredicate while doing a fetch. But , i am not exactly sure, which line is causing it. I am using a multithreaded coredata environment.
This issue is very intermittent and comes once in 10 sessions or so. Any help will be appreciated.
Thanks
As the others have said: do set a symbolic breakpoint on objc_exception_throw
and see which one of your executeFetchRequest
will trigger the error.
From the line with the executeFetchRequest
scroll up to where you define the predicate.
RHS
tends to stand for Right Hand Side. Assuming you are setting up the predicate with:
[NSPredicate predicateWithFormat:@"%K = %@", attribute, value];
then RHS
will be value
. Ensure that value
is not nil
.