Problem filtering NSArrayController
I have problem filtering an NSArrayController. Content Array is bound to an NSMutableArray holding NSDictionaries. I want开发者_JAVA百科 to filter all NSDictionaries whose "name" key equals "a". I run these two lines when my app launches but nothing gets filtered.
NSPredicate *filter = [NSPredicate predicateWithFormat: @"name like %@", @"a"];
[arrayController setFilterPredicate: filter];
NSPredicate *filter = [NSPredicate predicateWithFormat: @"name=%@", @"a"];
[arrayController setFilterPredicate: filter];
NSPredicate *filter = [NSPredicate predicateWithFormat:@"(name contains[cd] $a)"];
[arrayController setFilterPredicate: filter];
精彩评论