用NSPredicate 判断是否包含时,如果是对象,如判断对象的id,不能用not (SELF in %@),
应该用: not (SELF.id in %@), [array valueforkey:@“id”];
NSPredicate *DataPredicate = [NSPredicatepredicateWithFormat:@"SELF.iId !=0"];
NSArray *existData = [ allList filteredArrayUsingPredicate:DataPredicate];NSPredicate *predicate = [NSPredicatepredicateWithFormat:@"not (SELF.iId in %@)",[existDatavalueFo
rKey:@"iId"]];
----------------
取出一个数组中的对象的最大ID值
NSarray *array
maxId=[array valueForKeyPath:@"@max.iId"];