-[_SwiftValue integerValue]:无法识别的选择器发送到实例 0x60000044d560 使用 Google Mobile Vision 时出错
-[_SwiftValue integerValue]: unrecognized selector sent to instance 0x60000044d560 Error when using Google Mobile Vision
我正在我的应用程序中使用 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 帖子,发现大多数问题都来自字典。
我该如何解决这个问题?
使用枚举的原始值,GMVDetectorFaceLandmark.all.rawValue
等等
例如:
var faceDetector = GMVDetector(ofType: GMVDetectorTypeFace, options: [GMVDetectorFaceLandmarkType: GMVDetectorFaceLandmark.all.rawValue,
GMVDetectorFaceClassificationType: GMVDetectorFaceClassification.all.rawValue,
GMVDetectorFaceMinSize: 0.3,
GMVDetectorFaceTrackingEnabled: true])
我正在我的应用程序中使用 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 帖子,发现大多数问题都来自字典。
我该如何解决这个问题?
使用枚举的原始值,GMVDetectorFaceLandmark.all.rawValue
等等
例如:
var faceDetector = GMVDetector(ofType: GMVDetectorTypeFace, options: [GMVDetectorFaceLandmarkType: GMVDetectorFaceLandmark.all.rawValue,
GMVDetectorFaceClassificationType: GMVDetectorFaceClassification.all.rawValue,
GMVDetectorFaceMinSize: 0.3,
GMVDetectorFaceTrackingEnabled: true])