我正在尝试重新进入我的 conda 环境,但是当我输入conda activate (evironment name)或source activate (environment name)两者都返回错误“找不到 conda 环境”时,我遇到了问题。这很奇怪,因为当我输入时conda info --envs,我得到了这个:
# conda environments:
#
base * /Users/(my name)/anaconda3
/anaconda3/envs/(environment name)
Run Code Online (Sandbox Code Playgroud) 我正在尝试访问我正在编写的新应用程序的照片库。我有一个actionSheet,可让用户在相机和照片库之间进行选择。打开相机时,它会询问用户许可,但是打开照片库时,它不会。尽管如此,它仍然将用户带到他们的照片库。我在info.plist中专门引用了它,但是仍然没有区别。有什么帮助吗?我的代码:
@IBAction func allowAccessToPhotos(_ sender: Any) {
let imagePickerController = UIImagePickerController()
imagePickerController.delegate = self
let actionSheet = UIAlertController(title: "Photo Source", message: "Choose a Source", preferredStyle: .actionSheet)
actionSheet.addAction(UIAlertAction(title: "Photo Library", style: .default, handler: { (action:UIAlertAction) in imagePickerController.sourceType = .photoLibrary
self.present(imagePickerController, animated: true, completion: nil)
}))
actionSheet.addAction(UIAlertAction(title: "Camera", style: .default, handler: { (action:UIAlertAction) in imagePickerController.sourceType = .camera
self.present(imagePickerController, animated: true, completion: nil)
}))
actionSheet.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: nil))
self.present(actionSheet, animated: true, completion: nil)
}
Run Code Online (Sandbox Code Playgroud)