Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parse.com How to know if an array does not contain an object

there is a method for PFQuery

PFQuery *query = [PFQuery queryWithClassName:@"class"];
[query whereKey:(NSString *)key containsAllObjectsInArray:(NSArray *)array];

is there similar method to define if there is NO specified object in array? like

[query whereKey:(NSString *)key doesNotContainAllObjectsInArray:(NSArray *)array];

If no, how to code this method by myself?

like image 671
t0a0 Avatar asked Nov 14 '13 16:11

t0a0


1 Answers

You can use the whereKey:notContainedIn: method for it.Please have a look at the documentation of Parse. Here's the sudo code from the link.

// Finds scores from anyone who is neither Jonathan, Dario, nor Shawn
NSArray *names = @[@"Jonathan Walsh",
                   @"Dario Wunsch",
                   @"Shawn Simon"];
[query whereKey:@"playerName" notContainedIn:names];
like image 181
Rahul Singh Avatar answered Oct 18 '22 22:10

Rahul Singh