all any 或 此运算符后面必须跟_NSPredicate'ALL或ANY运算符的左侧必须是NSArray或NSSet'...

Not totally sure why this isn't working now, i thought it had been working previously. Does anyone see an issue with this FetchRequest construction?

- (NSArray *)entriesForDate:(NSDate *)date {

NSFetchRequest *request = [[NSFetchRequest alloc]initWithEntityName:@"Entry"];

NSPredicate *predicate = [NSPredicate predicateWithFormat:@"ANY addedOn.unique like %@", [T3Utility identifierForDate:date]];

request.predicate = predicate;

NSError *error = nil;

NSArray *matches = [self.database.managedObjectContext executeFetchRequest:request error:&error];

return matches;

}

Again, i'm 99% sure that this code has been working until recently, so im thinking perhaps there's something else going on in my code somewhere . . .but when i run it through the debugger this is where is hangs. Here is my error:

The left hand side for an ALL or ANY operator must be either an NSArray or NSSet

Any ideas?

thanks!

解决方案

It seems addedOn is not a to-many relationship. Make sure you use the correct names of your attributes / relationships in the predicate. Also, note that you cannot use a to-one relationship in a "ANY" predicate.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值