使用谓词“id in array”获取时,Core Data崩溃

时间:2013-06-25 07:22:27

标签: ios objective-c core-data nspredicate

我创建了一个获取来获取一些朋友('friend_id'是Friend实体的属性):

NSPredicate* perdicate = [NSPredicate predicateWithFormat:@"friend_id IN %@", aryFriendIds];

有时它会崩溃 - 一直发生到现在。

Thread 11:

0   libsystem_kernel.dylib        0x313bc848 __kill + 8

1   Messenger                     0x00026fcc -[CrashInfoReporter fatalSignal:Handler_Impl:With:] (CrashInfoReporter.m:575)

2   Messenger                     0x000250aa fatal_sig_handler (CrashInfoReporter.m:401)

3   libsystem_c.dylib             0x33ac47e6 _sigtramp + 42

4   CoreFoundation                0x3714fbe8 CFEqual + 100

5   CoreFoundation                0x3715b01e -[__NSCFString isEqual:] + 210

6   CoreFoundation                0x37165318 -[NSArray containsObject:] + 164

7   Foundation                    0x37aba56a -[NSInPredicateOperator performPrimitiveOperationUsingObject:andObject:] + 358

8   CoreData                      0x369e1b36 -[NSMemoryStoreInPredicateOperator performPrimitiveOperationUsingObject:andObject:] + 942

9   Foundation                    0x37a1a57e -[NSPredicateOperator performOperationUsingObject:andObject:] + 94

10  Foundation                    0x37a19be6 -[NSComparisonPredicate evaluateWithObject:substitutionVariables:] + 246

11  Foundation                    0x37a197bc -[NSPredicate evaluateWithObject:] + 16

12  CoreData                      0x36959284 -[NSManagedObjectContext executeFetchRequest:error:] + 2232

我无法弄清楚问题,因为我无法重现它,但崩溃线是4 CoreFoundation 0x3714fbe8 CFEqual + 100,我想问题可能是字符串比较。

感谢您的任何提示。


我尝试将NSNumber or NSArray object添加到aryFriendIds中以让CFEqual进行比较,但效果很好。

0 个答案:

没有答案