Filtering Arrays With Predicates

suggest change
NSArray *array = [NSArray arrayWithObjects:@"Nick", @"Ben", @"Adam", @"Melissa", nil];
NSPredicate *aPredicate = [NSPredicate predicateWithFormat:@"SELF beginswith[c] 'a'"];
NSArray *beginWithA = [array filteredArrayUsingPredicate:bPredicate];
     // beginWithA contains { @"Adam" }.
NSPredicate *ePredicate = [NSPredicate predicateWithFormat:@"SELF contains[c] 'e'"];
[array filterUsingPredicate:ePredicate];
    // array now contains { @"Ben", @"Melissa" }

More about

NSPredicate:

Apple doc : NSPredicate

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


NSArray:
*Filtering Arrays With Predicates

Table Of Contents