I am trying to use iCloud in my app. In the simulator, I notice that it takes a short amount of time after launch for new files in iCloud to be added to the ubiquity container. So to refresh my UI to reflect these changes, I set up an NSMetadataQuery as shown:
_query = [[NSMetadataQuery alloc] init];
_query.searchScopes = @[ubiquityContainer];
_query.predicate = [NSPredicate predicateWithFormat:@"%K == '*'", NSMetadataItemFSNameKey];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshFiles) name:NSMetadataQueryDidUpdateNotification object:nil];
[_query startQuery];
refreshFiles
is never called...
My app saves its files directly in ubiquityContainer
(an NSURL
) - it doesn't create any subdirectories...
What am I doing wrong?