摘要: Cocoa提供了一个类NSPredicate类,该类主要用于指定过滤器的条件,该对象可以准确的描述所需条件,对每个对象通过谓词进行筛选,判断是否与条件相匹配。谓词表示计算真值或假值的函数。 NSPredicate *predicate; predicate=[NSPredicatepredicateWithFormat:@"name=='Herbie'"];//用predicateWithFormat创建一个谓词,name作为键路径 BOOL match=[predicateevaluateWithObject:car];//car作为接收对象,evalua 阅读全文
posted @ 2013-10-30 17:08 yingkong1987 阅读(233) 评论(0) 推荐(0)