create folder on my iphone/ipad to store documents

This commit is contained in:
Danmei Chen 2019-01-08 16:01:30 +01:00
parent a62b5b932c
commit 5f94b2295f
2 changed files with 10 additions and 1 deletions

View file

@ -1029,8 +1029,15 @@ void on_chat_room_conference_alert(LinphoneChatRoom *cr, const LinphoneEventLog
}
- (NSURL *)getICloudFileUrl:(NSString *)name {
if (@available(iOS 11.0, *)) {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsPath = [paths objectAtIndex:0];
NSURL *url = [NSURL fileURLWithPath:documentsPath];
return [url URLByAppendingPathComponent:name];
}
NSFileManager *fileManager = [NSFileManager defaultManager];
NSURL *icloudPath = [[fileManager URLForUbiquityContainerIdentifier:nil]URLByAppendingPathComponent:@"Documents"];
NSURL *icloudPath = [[fileManager URLForUbiquityContainerIdentifier:nil] URLByAppendingPathComponent:@"Documents"];
if (icloudPath) {
if (![fileManager fileExistsAtPath:icloudPath.path isDirectory:nil]) {

View file

@ -159,6 +159,8 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportsDocumentBrowser</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>