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

Untitled

By: a guest on May 11th, 2012  |  syntax: None  |  size: 0.54 KB  |  hits: 17  |  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. What is the cause of error by using NSPredictate?
  2. #import "Predictate.h"
  3.  
  4. @implementation Predictate
  5.  
  6. @synthesize dictate;
  7.  
  8. -(id)init{
  9.     if ((self = [super init])) {
  10.     }
  11.     return self;
  12. }
  13.  
  14. - (void)Predictate{
  15.     dictate = [[NSMutableArray alloc]initWithObjects:@"AAA",@"BBB",@"CCC", nil];
  16.     NSPredicate *test = [NSPredicate predicateWithFormat:@"dictate like 'AAA'"];
  17.  
  18.     NSMutableArray *result = [dictate filteredArrayUsingPredicate:test];
  19.  
  20.     NSLog(@"%@",result);
  21. }
  22.  
  23. -(void)dealloc{
  24.     [dictate release];
  25.     [super dealloc];
  26. }
  27.  
  28. @end