OGeek|极客世界-中国程序员成长平台

标题: ios - 迅速 3 : present does not work on iOS 9 and older [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-11 18:21
标题: ios - 迅速 3 : present does not work on iOS 9 and older

我正在尝试呈现一个 UIImagePickerController 并且当我使用时:

self.present(picker, animated: true, completion: nil)

我得到这个错误:

'NSPersistentContainer' is only available on iOS 10.0 or newer

我希望我的应用支持 iOS 8 及更高版本

编辑: 选择器代码:

  if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.photoLibrary) {
        var imagePicker = UIImagePickerController()
        imagePicker.delegate = self
        imagePicker.sourceType = UIImagePickerControllerSourceType.photoLibrary
        imagePicker.allowsEditing = true
        self.present(imagePicker, animated: true, completion: nil)
    }



Best Answer-推荐答案


根据苹果文档:https://developer.apple.com/reference/coredata/nspersistentcontainer

我们可以在右侧看到:

SDKs

iOS 10.0+
macOS 10.12+
tvOS 10.0+
watchOS 3.0+

表示如果你开发 iOS,NSPersistentContainer 只能在 iOS 10.0 或更新版本中使用。无法在 iOS 8 或低于 iOS 10 的系统中使用

关于ios - 迅速 3 : present does not work on iOS 9 and older,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41233749/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (https://ogeek.cn/) Powered by Discuz! X3.4