From 9df53f633f8650b5dd7fea767f0086135920e32c Mon Sep 17 00:00:00 2001 From: Sam Spencer Date: Tue, 27 Jan 2015 19:53:22 -0500 Subject: [PATCH] Fixed Metadata Query Update Methods Updated NSMetadataQuery notification methods, fixes #64. --- iCloud/iCloud.m | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/iCloud/iCloud.m b/iCloud/iCloud.m index 84fcb18..2986867 100755 --- a/iCloud/iCloud.m +++ b/iCloud/iCloud.m @@ -232,7 +232,7 @@ - (void)enumerateCloudDocuments { }); } -- (void)startUpdate:(NSMetadataQuery *)query { +- (void)startUpdate:(NSNotification *)notification { // Log file update if (self.verboseLogging == YES) NSLog(@"[iCloud] Beginning file update with NSMetadataQuery"); @@ -243,7 +243,7 @@ - (void)startUpdate:(NSMetadataQuery *)query { }); } -- (void)recievedUpdate:(NSMetadataQuery *)query { +- (void)recievedUpdate:(NSNotification *)notification { // Log file update if (self.verboseLogging == YES) NSLog(@"[iCloud] An update has been pushed from iCloud with NSMetadataQuery"); @@ -251,7 +251,7 @@ - (void)recievedUpdate:(NSMetadataQuery *)query { [self updateFiles]; } -- (void)endUpdate:(NSMetadataQuery *)query { +- (void)endUpdate:(NSNotification *)notification { // Get the updated files [self updateFiles]; @@ -302,13 +302,12 @@ - (void)updateFiles { [self.delegate iCloudFilesDidChange:discoveredFiles withNewFileNames:names]; }); } - } - else if ([fileStatus isEqualToString:NSURLUbiquitousItemDownloadingStatusNotDownloaded]) { - NSError *err; - BOOL downloading = [[NSFileManager defaultManager] startDownloadingUbiquitousItemAtURL:fileURL error:&err]; + } else if ([fileStatus isEqualToString:NSURLUbiquitousItemDownloadingStatusNotDownloaded]) { + NSError *error; + BOOL downloading = [[NSFileManager defaultManager] startDownloadingUbiquitousItemAtURL:fileURL error:&error]; if (self.verboseLogging == YES) NSLog(@"[iCloud] %@ started downloading locally, successful? %@", [fileURL lastPathComponent], downloading ? @"YES" : @"NO"); - if (err) { - if (self.verboseLogging == YES) NSLog(@"[iCloud] Ubiquitous item failed to start downloading with error: %@", err); + if (error) { + if (self.verboseLogging == YES) NSLog(@"[iCloud] Ubiquitous item failed to start downloading with error: %@", error); } } }];