gpt4 book ai didi

ios - AVCaptureSession 未在 xcode 8.3 中识别

转载 作者:行者123 更新时间:2023-11-29 11:42:53 24 4
gpt4 key购买 nike

我是 iOS 开发的新手,我正在尝试按照本教程尝试苹果必须提供的新机器学习功能!

https://www.youtube.com/watch?v=p6GA8ODlnX0

不幸的是,当我尝试使用 AVCaptureSession() 构建实例时,视频播放 3 分钟后,xcode 给我一个错误提示“使用未解析的标识符‘AVCapture’”。

我不确定我做错了什么。到目前为止,我已经在这里展示了我的代码并附上了我的 xcode UI 的屏幕截图。

import UIKit
import AVKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
//here is where we start up the camera
let captureSession = AVCaptureSession()
}
}

显示错误时的 xcode UI 图像

enter image description here

非常感谢任何帮助,是的,我尝试清理和重建以及重新启动 xcode,但没有成功。

最佳答案

您需要在类文件中导入 AVFoundation。引用这个AVFoundation framework

关于ios - AVCaptureSession 未在 xcode 8.3 中识别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45527350/

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