Objective-C Tips & Trick - Prioregroup.com
[Objective-C] Filter an NSArray of NSDictionary with NSPredicate
       
back

NSPredicate *filter = [NSPredicate predicateWithBlock:^BOOL(id evaluatedObject, NSDictionary *bindings) {
        return [[evaluatedObject valueForKeyPath:@"activity.object.type"]
                isEqualToString:@"FILTER-TEXT-VALUE"];
}];
NSArray *new_array = [you-array filteredArrayUsingPredicate:filter];






Copyright © 1996-2018 Centro Studi Informatica di Danilo Priore. All rights reserved. P.I.10149810581.
prioregroup.com