我正在使用NScoding加载NSMutableArray;这个就好加载了:如何根据float过滤NSmutableArray
_patients = [RND_PatientDB loadPatientData];
的_Patients NSMutableArray中的每个对象都有一个称为“已完成”浮动。
我尝试从具有_patients.completed == 1 “_pateints” 的NSMutableArray中仅筛选的对象:
NSNumber *num1 = [NSNumber numberWithFloat:1.0];
NSPredicate *sPredicate = [NSPredicate predicateWithFormat:@"completed == %@", num1];
patientsFiltered = [[_patients filteredArrayUsingPredicate:sPredicate] mutableCopy];
我得到这个错误:
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ valueForUndefinedKey:]: this class is not key value coding-compliant for the key completed.
任何想法?
我有疑问,我们可以定义完成为float而不是bool吗? – bllakjakk 2014-09-21 12:16:30