gpt4 book ai didi

ios - 应用程序无法访问您的照片或视频 iOS 9

转载 作者:IT王子 更新时间:2023-10-29 07:56:53 25 4
gpt4 key购买 nike

当我使用 UIImagePicker 访问我的照片库以选择照片时,该应用程序有时会显示黑屏,有时会显示一个屏幕,提示我必须授予我的应用程序访问照片的权限。但是当我转到“设置”->“隐私”->“照片”时,那里没有应用程序,而且在“设置”中也看不到该应用程序。我读到我必须向我的 Info.plist 添加两个值,但它们也没有用。有没有人遇到同样的错误?我正在使用 xcode 7、swift 2.0 和 iOS 9

enter image description here

这是我提示用户访问相机的地方

@IBAction func cameraButtonPressed(sender: UIButton) {

let actionSheet = UIAlertController(title: nil, message: nil, preferredStyle: UIAlertControllerStyle.ActionSheet)

let cancelAction = UIAlertAction(title: "Cancel", style: .Default) { (UIAlertAction) -> Void in
self.dismissViewControllerAnimated(true, completion: nil)
}

let cameraAction = UIAlertAction(title: "Take Photo", style: .Default) { (UIAlertAction) -> Void in
if UIImagePickerController.availableCaptureModesForCameraDevice(.Rear) != nil {
self.imagePicker.allowsEditing = false
self.imagePicker.sourceType = UIImagePickerControllerSourceType.Camera
self.imagePicker.cameraCaptureMode = .Photo
self.presentViewController(self.imagePicker, animated: true, completion: nil)
} else {
self.noCamera()
}
}

let photoLibraryAction = UIAlertAction(title: "Photo Library", style: .Default) { (UIAlertAction) -> Void in
self.imagePicker.sourceType = UIImagePickerControllerSourceType.PhotoLibrary
self.presentViewController(self.imagePicker, animated: true, completion: nil)
}

actionSheet.addAction(photoLibraryAction)
actionSheet.addAction(cameraAction)
actionSheet.addAction(cancelAction)

self.presentViewController(actionSheet, animated: true, completion: nil)

}

最佳答案

当您的应用程序 Info.plist 文件包含一个键:具有空字符串值的“CFBundleDisplayName”时,此问题会出现在 iOS 9 中。

您可以在那里输入您的应用名称,它应该可以工作。

关于ios - 应用程序无法访问您的照片或视频 iOS 9,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32768012/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com