Advertisement
Guest User

Untitled

a guest
Aug 13th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. IF ([myArray containsObject:term]) {...}
  2.    
  3. IF ([myArray indexOfObjectPassingTest:^(id obj, NSUInteger idx, BOOL *STOP){
  4.          RETURN [obj caseInsensitiveCompare:term] == NSOrderedSame;
  5.      }] != NSNotFound) {
  6.     // there's at least one object that matches term case-insensitively
  7. }
  8.  
  9. - (BOOL)containsObject:(id)anObject
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement