【发布时间】:2011-12-21 16:02:13
【问题描述】:
如何使用 NSPredicate 过滤数组的 ->_title 变量中的对象等于变量 title 的数组?我在下面尝试了以下方法,但它没有过滤掉任何东西。
NSMutableArray *array = [[posts mutableCopy] autorelease];
NSString *title = [[TBForrstr sharedForrstr] stringForPostType:type];
[array filterUsingPredicate:[NSPredicate predicateWithFormat:[NSString stringWithFormat:@"SELF->_title == %@", title]]];
【问题讨论】:
标签: objective-c nsarray nspredicate