Filtering Array content with Predicate

suggest change

filteredArrayUsingPredicate: evaluates a predicate against the array’s contents and returns the objects that match. (filterUsingPredicate: is the in-place variant on NSMutableArray.)

Example:

NSMutableArray *array = [NSMutableArray array];
[array setArray:@[@"iOS",@"macOS",@"tvOS"]];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF beginswith[c] 'i'"];
NSArray *resultArray = [array filteredArrayUsingPredicate:predicate];
NSLog(@"%@",resultArray);

Feedback about page:

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



Table Of Contents