0
我想问的数据结构。 Data
是Transformable
字段,该字段又是NSDictionary
。NSPredicate尝试使用CONTAINS时崩溃
Obj = { //...
NSDictionary *data:@{
likesPeople:@[@{@"username":@"jack",@"id":@"ae3132"}]
}
}
我想要做的是NSArray *fetchResult
内搜索,以检查有没有人在likesPeople
与X id
。 我这样做的尝试总是最终崩溃,突出显示我的NSPredicate
声明中存在问题。
我在做什么错,我怎样才能有效地获取我想要的信息?
SocialWall *theSocialWall = fetchResult[0];
NSLog(@"%@",theSocialWall.data);
NSPredicate * predicate = [NSPredicate predicateWithFormat:@"data.likesPeople CONTAINS(c) %@",myUser.userWebID];
NSArray * result = [fetchResult filteredArrayUsingPredicate:predicate];
NSLog(@"%@",result);