I have been programming in objective-C for about a year now, but i am new to cloud kit. I can do simple things such as fetch, save and delete Records but I have not been able to find a way of deleting multiple Records at a time. I tried a for loop but, although there were no errors, nothing was deleted. heres some of the code:
for (CKRecord* r in self.allRecords) {
[[[CKContainer defaultContainer] publicCloudDatabase] deleteRecordWithID:r.recordID completionHandler:^(CKRecordID *recordID, NSError *error) {
if (error) {
NSLog(@"error");
}else
NSLog(@"deleted");
}];
}
allRecords is an array containing the records which i need deleting but it does not delete any of the records. Thanks