-1

Hello I want to use predicate in my application.In my application, I have one class(named JigsawView) which contains one BOOL property (named isSelected).Now i have one array which contains instances of JigsawView.I want to find that instances whose isSelected property is set to YES using predicate.Please help me.Thanking you.

4

2 回答 2

3
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"isSelected == YES"]; 
NSArray *filteredArray = [yourArray filteredArrayUsingPredicate:predicate];
于 2013-07-31T06:09:36.893 回答
2
NSArray* resultArray = [yourArray filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"isSelected = YES"]]
于 2013-07-31T06:07:57.937 回答