0
CKContainer *c= [CKContainer defaultContainer];
CKDatabase *openbase=c.publicCloudDatabase;
CKDatabase *privateDatabase=c.privateCloudDatabase;
NSPredicate *predicate=[NSPredicate predicateWithValue:YES];
CKQuery *q=[[CKQuery alloc]initWithRecordType:@"Notesss" predicate:predicate];
[openbase performQuery:q inZoneWithID:nil completionHandler:^(NSArray<CKRecord *> * _Nullable results, NSError * _Nullable error) {
if (error!=nil) {
NSLog(@"%@",error);
} else {
[results enumerateObjectsUsingBlock:^(CKRecord * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
NSString *title= [obj valueForKey:@"title"];
if([title containsString:[NSString stringWithFormat:@"%ld",(long)row+1]]){
CKAsset *imageA=[obj valueForKey:@"dataImage"];
dispatch_sync(dispatch_get_main_queue(), ^{
self.imageV.image=[UIImage imageWithContentsOfFile:imageA.fileURL.path];
});
};
}];
}}];
- 是否最新要求從iCloud?
- 當我從iCloud請求時,可以使用SDWebImage嗎?