To delete a document from iCloud, you must first get the name of the file you want to delete. and then you can delete it using NSFileManager.
NSString *saveFileName = @"Report.pdf";
NSURL *ubiq = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil];
NSURL *ubiquitousPackage = [[ubiq URLByAppendingPathComponent:@"Documents"] URLByAppendingPathComponent:saveFileName];
NSFileManager *filemgr = [NSFileManager defaultManager];
[filemgr removeItemAtURL:ubiquitousPackage error:nil];
This is the way I used to delete a document, check it out. This is great for me. Thanks
source
share