My NSMutableArray
contains the following data
<DoctorInfo: 0x15de99e0> (entity: DoctorInfo; id: 0x15defbe0 <x-coredata://39D9B/DoctorInfo/p8> ; data: {
doctorName = nil;
emailAdd = nil;
hospitalName = nil;
mobileNumber = nil;
phoneNumber = nil;
}),
<DoctorInfo: 0x15de9b00> (entity: DoctorInfo; id: 0x15da5dc0 <x-coredata://39D9BED3/DoctorInfo/p10> ; data: {
doctorName = nil;
emailAdd = nil;
hospitalName = nil;
mobileNumber = nil;
phoneNumber = nil;
})
)
How can I remove those objects with nil
? I have tried the following code by changing NSMutableArray
to the NSArray
and then filter it but it is still not working:
NSString *predString = [NSString stringWithFormat:@"(doctorName BEGINSWITH[cd] '%@')", nil];
NSPredicate *pred = [NSPredicate predicateWithFormat:predString];
self.filteredDocInfoArray = [self.unfilteredDocInfoArray filteredArrayUsingPredicate:pred];