开发者

Problem filtering NSArrayController

开发者 https://www.devze.com 2023-02-04 22:32 出处:网络
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 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

精彩评论

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