- [_ SwiftValue integerValue]:无法识别的选择器发送到实例0x60000044d560使用Google Mobile Vision时出错

问题描述 投票:0回答:1

我在我的应用中使用Google Mobile Vision。我得到一个无法识别的选择器lldb崩溃。我已经将问题缩小到这行代码......

   var faceDetector = GMVDetector.init(ofType: GMVDetectorTypeFace, options: options)

这是变量options

let options = [GMVDetectorFaceLandmarkType: GMVDetectorFaceLandmark.all, GMVDetectorFaceClassificationType: GMVDetectorFaceClassification.all, GMVDetectorFaceTrackingEnabled: false] as [String : Any]

options有什么问题吗?我查看了其他SO帖子,发现大多数问题都来自字典。

我该如何解决这个问题?

ios dictionary swift4 google-vision
1个回答
0
投票

使用枚举的原始值,GMVDetectorFaceLandmark.all.rawValue等。

例如:

var faceDetector = GMVDetector(ofType: GMVDetectorTypeFace, options: [GMVDetectorFaceLandmarkType: GMVDetectorFaceLandmark.all.rawValue,
                                                                               GMVDetectorFaceClassificationType: GMVDetectorFaceClassification.all.rawValue,
                                                                               GMVDetectorFaceMinSize: 0.3,
                                                                               GMVDetectorFaceTrackingEnabled: true])
© www.soinside.com 2019 - 2024. All rights reserved.