开发者

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];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜