Posted By

sag333ar on 03/07/11


Tagged

filter xcode Objective-c iphone NSDictionary NSArray iOS4 iPhone3G iPhone2G


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

sag333ar
terababy
Tintenklecks
cnathan


filtering NSArray of NSDictionaries


 / Published in: Objective C
 

  1. NSArray *ar=[NSArray arrayWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"TheaterLocations" ofType:@"plist"]];
  2.  
  3. NSArray *filtered = [ar filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"(id == %@)", [sender titleForState:UIControlStateDisabled]]];
  4. NSLog(@"%@",filtered);

Report this snippet  

You need to login to post a comment.