尝试获取库图像选择器时的 Sigbart

Posted

技术标签:

【中文标题】尝试获取库图像选择器时的 Sigbart【英文标题】:Sigbart When Trying To Get Library Image Picker 【发布时间】:2016-07-21 21:49:21 【问题描述】:

当我尝试为我的社交媒体应用获取图像选择器控制器时,它给了我一个错误!

[access] <private>

我尝试制作另一个项目并使用其他视图控制器和 UITapGestureRecognizers,但没有任何效果! 请帮忙!

控制台: 2016-07-21 17:43:29.439339 发布 [3012:763270] [辅助功能] ****************** 加载 GAX 客户端包 ********* ******* 2016-07-21 17:43:31.098400 发布 [3012:763270] [MC] systemgroup.com.apple.configurationprofiles 路径的系统组容器是 /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles 2016-07-21 17:43:31.108233 发布 [3012:763270] [MC] 从公共有效用户设置中读取。 2016-07-21 17:43:37.273218 发布[3012:763430] [访问] (lldb)

代码:

class LoginVC: UIViewController, UIImagePickerControllerDelegate,    UINavigationControllerDelegate 

override func viewDidLoad() 
    super.viewDidLoad()

    // Do any additional setup after loading the view.


override func didReceiveMemoryWarning() 
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.



/*
// MARK: - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: AnyObject?) 
    // Get the new view controller using segue.destinationViewController.
    // Pass the selected object to the new view controller.

*/
@IBAction func test(_ sender: AnyObject) 
    let pickerImg = UIImagePickerController()
    pickerImg.delegate = self
    pickerImg.sourceType = .photoLibrary
    pickerImg.allowsEditing = true
    present(pickerImg, animated: true, completion: nil)

【问题讨论】:

【参考方案1】:

这已在 Swift 的未来版本中得到修复。

【讨论】:

以上是关于尝试获取库图像选择器时的 Sigbart的主要内容,如果未能解决你的问题,请参考以下文章

当用户取消意图选择器时是不是有事件?

在 driver.execute_script() 中使用伪选择器时无法将某些元素滚动到视图中

使用 AJAX 选择下拉菜单选择器时遇到问题

使用联系人选择器时从具有多个号码的用户中选择一个号码

打开小部件选择器时系统设置强制关闭

获取图像地理位置(从图像选择器中选择)