Skip to content

Commit 9df53f6

Browse files
author
Sam Spencer
committed
Fixed Metadata Query Update Methods
Updated NSMetadataQuery notification methods, fixes #64.
1 parent 2585517 commit 9df53f6

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

iCloud/iCloud.m

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ - (void)enumerateCloudDocuments {
232232
});
233233
}
234234

235-
- (void)startUpdate:(NSMetadataQuery *)query {
235+
- (void)startUpdate:(NSNotification *)notification {
236236
// Log file update
237237
if (self.verboseLogging == YES) NSLog(@"[iCloud] Beginning file update with NSMetadataQuery");
238238

@@ -243,15 +243,15 @@ - (void)startUpdate:(NSMetadataQuery *)query {
243243
});
244244
}
245245

246-
- (void)recievedUpdate:(NSMetadataQuery *)query {
246+
- (void)recievedUpdate:(NSNotification *)notification {
247247
// Log file update
248248
if (self.verboseLogging == YES) NSLog(@"[iCloud] An update has been pushed from iCloud with NSMetadataQuery");
249249

250250
// Get the updated files
251251
[self updateFiles];
252252
}
253253

254-
- (void)endUpdate:(NSMetadataQuery *)query {
254+
- (void)endUpdate:(NSNotification *)notification {
255255
// Get the updated files
256256
[self updateFiles];
257257

@@ -302,13 +302,12 @@ - (void)updateFiles {
302302
[self.delegate iCloudFilesDidChange:discoveredFiles withNewFileNames:names];
303303
});
304304
}
305-
}
306-
else if ([fileStatus isEqualToString:NSURLUbiquitousItemDownloadingStatusNotDownloaded]) {
307-
NSError *err;
308-
BOOL downloading = [[NSFileManager defaultManager] startDownloadingUbiquitousItemAtURL:fileURL error:&err];
305+
} else if ([fileStatus isEqualToString:NSURLUbiquitousItemDownloadingStatusNotDownloaded]) {
306+
NSError *error;
307+
BOOL downloading = [[NSFileManager defaultManager] startDownloadingUbiquitousItemAtURL:fileURL error:&error];
309308
if (self.verboseLogging == YES) NSLog(@"[iCloud] %@ started downloading locally, successful? %@", [fileURL lastPathComponent], downloading ? @"YES" : @"NO");
310-
if (err) {
311-
if (self.verboseLogging == YES) NSLog(@"[iCloud] Ubiquitous item failed to start downloading with error: %@", err);
309+
if (error) {
310+
if (self.verboseLogging == YES) NSLog(@"[iCloud] Ubiquitous item failed to start downloading with error: %@", error);
312311
}
313312
}
314313
}];

0 commit comments

Comments
 (0)