gpt4 book ai didi

ios - 在 swift 4 中将 UIImagePickerController 呈现给照片库后崩溃;隐私已添加到 info.plist

转载 作者:行者123 更新时间:2023-11-28 07:21:36 27 4
gpt4 key购买 nike

使用 photoLibrary sourceType 访问 UIImagePickerController 时崩溃;隐私已添加到 info.plist

let myPickerController = UIImagePickerController()
myPickerController.delegate = self
myPickerController.sourceType = .photoLibrary
self.present(myPickerController, animated: true, completion: nil)'

错误:

unrecognized selector sent to instance 0x28184fb40 2019-09-09 12:45:52.126598+0300 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFType encodeWithCoder:]: unrecognized selector sent to instance 0x28184fb40'

最佳答案

我假设您点击一个按钮来启动您的 UIImagePickerController。我怀疑如果您使用界面生成器设计按钮,您可能会将按钮连接到多个 IBAction 方法。

转到您的 Storyboard并右键单击该按钮。如果该按钮连接到多个“已发送事件”,那就是您的问题。删除不相关的(也许你在代码中删除的旧的仍然连接)。

关于ios - 在 swift 4 中将 UIImagePickerController 呈现给照片库后崩溃;隐私已添加到 info.plist,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57851609/

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