数组中满含有某自定义对象,如果要取出特定对象的值,一般要用for循环遍历一遍,但是总给我一种不够高端大气上档次的感觉.
于是乎就有了NSPredicate,类似于正则表达式进行条件筛选
NSPredicate *pred = [NSPredicate predicateWithFormat:@"SCUploadType == %d", SCUploadTypeMovie];
NSArray* filerArray = [self.uploadArray filteredArrayUsingPredicate:pred];
是不是很方便