Привет новогодним людям.
Мне нужно получить доступ к plist внутри контейнера группы приложения.
Чтобы получить доступ в изолированной системе, что мне нужно сделать, чтобы сделать это правильно. Я прочитал, а затем ответил на Создать каталог в быстром контейнере группы приложений, но не удается найти соответствующие настройки прав в XCode 11.
Есть ли соответствующая функция URL или пути (String) для вызова? Насколько я вижу, опция .groupContainerDirectory недоступна.
Теперь я пытаюсь использовать следующий код...
let appIdentifier = "UBF8T346G9.Office"
let fileManager = FileManager.default
let container = fileManager.containerURL(forSecurityApplicationGroupIdentifier: appIdentifier)
print("Container \(container)")
do{
if let container = container {
let directoryPath = container.appendingPathComponent("Profile Settings")
var isDir : ObjCBool = false
let path = directoryPath.path
if fileManager.fileExists(atPath: path, isDirectory: &isDir) {
if isDir.boolValue {
print("file exists and is a directory")
let plistPath = url.appendingPathComponent( "com.microsoft.visualbasic.plist").path
let plistDict = NSDictionary(contentsOfFile: plistPath)
if let dict = plistDict {
print("Dict: \(dict)") // <<<<<< Never comes here
}
}
}
}
} catch let error as NSError {
print(error.description)
}
}
конечно, не работает, потому что мне нужно какое-то приложение для доступа к их "групповому контейнеру"
Спасибо.