【问题标题】:CIDetector with CIDetectorTypeQRCode works on iPad but not on iPhone and iPod带有 CIDetectorTypeQRCode 的 CIDetector 适用于 iPad,但不适用于 iPhone 和 iPod
【发布时间】:2015-10-13 09:51:35
【问题描述】:

当我尝试使用CIDetector读取iPhone或iPod上的二维码时,检测器总是返回nil

NSDictionary *detectorOptions = @{@"CIDetectorAccuracy": @"CIDetectorAccuracyHigh"};

CIDetector * detector = [CIDetector  detectorOfType:CIDetectorTypeQRCode context:nil options:detectorOptions];

在 iPad 上运行此代码有效。 所有设备都在 iOS 9 上,使用 Xcode 7.0.1

其他检测器工作正常,比如人脸检测成功:

detector = [CIDetector detectorOfType:CIDetectorTypeFace context:nil options:detectorOptions];

是否有额外的设置/库让 QRCode 检测器在 iPhone / iPod 上工作?

【问题讨论】:

  • 设备到底是什么?您扫描的是完全相同的图像吗?例如,如果它来自相机,则相机可能太差而无法扫描小 QRCode,并且每个设备都不同。
  • 我的问题不是检测器在图像中找不到二维码;问题是 CIDetector 甚至没有在我的物理 iPhone 5 和第 5 代 iPod 上实例化,只在我的 iPad Air 2 上实例化。我添加了确切的硬件版本,因为这可能是与 GPU 相关的问题?
  • 我也面临同样的问题,我用 ipad 和 iphone 都试过了,我无法在 CIDetectorTypeQRCode 模式下实例化 CIDetector。
  • 在 iPad 中检测二维码时,我得到 CIDetector nil。让我知道正确的解决方案。

标签: ios objective-c iphone ipad cidetector


【解决方案1】:

是的,根据我的测试,它在触摸时不起作用。但在 iPhone 和 iPad 上运行良好。

【讨论】:

  • 它不适用于我的 iPhone 5,但适用于 6 Plus。也许它只适用于带指纹扫描仪的设备?
猜你喜欢
  • 1970-01-01
  • 2012-06-18
  • 2011-03-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多