我正在尝试编写一个表达的NSPredicate
:"如果UID包含Myid或Targetuser"
但是,无论我尝试什么,它似乎都不想起作用。如何在下面编辑我的行以执行上述?
我当前的代码:
NSPredicate *p3 = [NSPredicate predicateWithFormat:@"uid contains[cd] %@", myID];
我尝试了以下内容,但没有骰子:
NSPredicate *p3 = [NSPredicate predicateWithFormat:@"uid contains[cd] %@ OR contains[cd] %@", myID, targetUser];
NSPredicate *p3 = [NSPredicate predicateWithFormat:@"(uid contains[cd] %@) OR (uid contains[cd] %@)", myID, targetUser];
尝试这个:
NSPredicate *predicate=[NSPredicate predicateWithFormat:@"uid contains[cd] %@ OR uid contains[cd] %@", myID, targetUser];