自 2013 年以来,我在 AppStore 中有一个应用程序,它总是完美无缺。它在 iCloud 上创建和同步文件。
由于 iOS14 startDownloadingUbiquitousItemAtURL 只下载现有文件的一小部分。如果我在模拟器和 iOS14 中启动应用程序(当然也在真实设备上)。如果我使用 iOS12 或 13 在模拟器中启动应用程序,它会按预期工作。
我在网上找不到任何关于 startDownloadingUbiquitousItemAtURL 方法可能发生的变化的信息。
这是有问题的代码:
...
BOOL tt = [[NSFileManager defaultManager] startDownloadingUbiquitousItemAtURL:cloudFileUrl error:&error] ;
if (error != nil)
{
NSLog(@"ERROR Loading %@", cloudFileUrl) ;
}
...
tt 为真且错误为 nil,因此似乎同步过程已正确启动
但是,如果我尝试使用
NSArray *dirContent = [[NSFileManager defaultManager] contentsOfDirectoryAtURL:cloudFileUrl includingPropertiesForKeys:[[NSArray alloc] initWithObjects:NSURLNameKey, nil] options:NSDirectoryEnumerationSkipsHiddenFiles error:&error];
数组 dirContent 仅包含 3 或 4 个元素,即使该文件夹包含 10 个文件。
知道问题可能是什么吗?我也打开了苹果的一个错误。