Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 11th, 2012  |  syntax: None  |  size: 0.35 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to use key-paths in NSPredicate on an NSArray of NSStrings?
  2. - (void)Predictate{
  3.     dictate = [[NSMutableArray alloc]initWithObjects:@"AAA",@"BBB",@"CCC", nil];
  4.  
  5.     NSPredicate *test = [NSPredicate predicateWithFormat:@"dictate like 'AAA'"];
  6.  
  7.     NSMutableArray *result = [dictate filteredArrayUsingPredicate:test];
  8.  
  9.     NSLog(@"%@",result);
  10. }