I m trying to use UIDocument without iCloud when the user has iCloud disabled. I have the following code:
NSURL *url;
if (_isiCloudEnabled) {
NSURL *ubiq = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil];
url = [ubiq URLByAppendingPathComponent:[NSString stringWithFormat:@"%f.adoc",[[NSDate date] timeIntervalSince1970]]];
} else {
NSString *homeDirectoryPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString *newFilePath = [homeDirectoryPath stringByAppendingPathComponent:[NSString stringWithFormat:@"%f.adoc", [[NSDate date] timeIntervalSince1970]]];
url = [NSURL URLWithString:newFilePath];
}
ASListyDocument *d = [[ASListyDocument alloc] initWithFileURL:url];
该法典给我留下了错误:
*** Terminating app due to uncaught exception NSInvalidArgumentException , reason: must pass a valid file URL to -[UIDocument initWithFileURL:]
是什么想法呢?” 我认为,LL是 de弄的,似乎是正确的。 我还尝试在模拟和打电话上播放。
顺便说一句,Im在一台带有5号的装置上运行,如果是这样的话。