title: icloud doesn't update the download precess
body: <p>Usually, my code is ok to download the files from iCloud. But sometimes the downloading process will not be updated.</p>
  
  <p>Following are some code snips:</p>
  
  <p>start download:</p>
  
  <pre><code>            NSFileManager*  fm = [NSFileManager defaultManager];
          if (![fm startDownloadingUbiquitousItemAtURL:file error:nil]) {
              return NO;
          }
  
          /////////////////////////
          id query = [[icloudClass alloc] init];
          _query = query;
  
          [query setSearchScopes:[NSArray arrayWithObject:NSMetadataQueryUbiquitousDocumentsScope]];
  
          NSArray *listItems = [[file path] componentsSeparatedByString:@"/"];
  
          NSPredicate *pred = [NSPredicate predicateWithFormat: @"%K == %@", NSMetadataItemFSNameKey, [listItems objectAtIndex:[listItems count] -1] ];
          NSLog(@"filename = %@", [listItems objectAtIndex:[listItems count] -1]);
          [query setPredicate:pred];
  
         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateDownloading:) name:NSMetadataQueryDidUpdateNotification object:query];
  
          [query startQuery];
  </code></pre>
  
  <p>update download:</p>
  
  <pre><code>    -(void)updateDownloading:(NSNotification *)notification {
      id query = [notification object];
  
  
      if ([query resultCount] /*&gt;=*/ == 1) {
          for (int i=0; i&lt;[query resultCount]; ++i) {
              NSMetadataItem *item = [query resultAtIndex:i];
  
              //debug
              NSNumber* isDownloading = [item valueForAttribute:NSMetadataUbiquitousItemIsDownloadingKey];
              NSNumber* isDownloaded  = [item valueForAttribute:NSMetadataUbiquitousItemIsDownloadedKey];
              NSNumber* perDownloading = [item valueForAttribute:NSMetadataUbiquitousItemPercentDownloadedKey];
  
              NSLog(@"isDownloaded=%@", [isDownloaded boolValue]?@"Yes":@"No");
              NSLog(@"isDownloading=%@", [isDownloading boolValue]?@"Yes":@"No");
              NSLog(@"percent downloaded=%f", [perDownloading doubleValue]);
              //
  
              if ([isDownloaded boolValue]) {
  
                  [query disableUpdates];
                  [query stopQuery];
                  [[NSNotificationCenter defaultCenter] removeObserver:self name:NSMetadataQueryDidUpdateNotification object:query];
                  _query = nil;
  
  
                  NSLog(@"----------end download!------------------");
  
  
  
              }
  
          }//end for
      } 
  }
  </code></pre>
  
  <p>please note that the update function will only be invoked once with the following console print, and never will be invoked even restart the app.</p>
  
  <pre><code>Jan 10 15:20:27 unknown *[1383] &lt;Warning&gt;: isHasConflict=No
  Jan 10 15:20:27 unknown *[1383] &lt;Warning&gt;: isDownloaded=No
  Jan 10 15:20:27 unknown *[1383] &lt;Warning&gt;: isDownloading=No
  Jan 10 15:20:27 unknown *[1383] &lt;Warning&gt;: percent downloaded=0.000000
  </code></pre>
  
  <p>Does anyone met this problem before?</p>