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

Untitled

By: a guest on Jun 13th, 2012  |  syntax: None  |  size: 0.59 KB  |  hits: 10  |  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. NSMutableArray *ivarPrevious = [NSMutableArray arrayWithCapacity:1];
  2.  
  3. -(void)foo
  4. {
  5.     NSMutableArray *newivarPrevious = [NSMutableArray arrayWithCapacity:1];
  6.     for (...){          
  7.         NSMutableDictionary *ret = [NSMutableDictionary dictionaryWithCapacity:1];
  8.         [ret setObject:foo forKey:@"foo"];
  9.         [ret setObject:bar forKey:@"bar"];
  10.         [newivarPrevious addObject:[ret description]];                
  11.         if (![ivarPrevious containsObject:[ret description]]) {
  12.             //new
  13.         }
  14.     }
  15.     [ivarPrevious removeAllObjects];
  16.     [ivarPrevious setArray:newivarPrevious];
  17. }