Skip to content

Instantly share code, notes, and snippets.

@samvermette
Created February 5, 2012 21:19
Show Gist options
  • Select an option

  • Save samvermette/1747988 to your computer and use it in GitHub Desktop.

Select an option

Save samvermette/1747988 to your computer and use it in GitHub Desktop.

Revisions

  1. samvermette renamed this gist Feb 7, 2012. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. samvermette created this gist Feb 5, 2012.
    10 changes: 10 additions & 0 deletions iCloud Notification.m
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    - (void)queryDidReceiveNotification:(NSNotification *)notification {
    NSArray *results = [self.metadataQuery results];

    for(NSMetadataItem *item in results) {
    NSString *filename = [item valueForAttribute:NSMetadataItemDisplayNameKey];
    NSNumber *filesize = [item valueForAttribute:NSMetadataItemFSSizeKey];
    NSDate *updated = [item valueForAttribute:NSMetadataItemFSContentChangeDateKey];
    NSLog(@"%@ (%@ bytes, updated %@)", filename, filesize, updated);
    }
    }