MxABC / swiftScan

A barcode and qr code scanner( 二维码 各种码识别,生成,界面效果)
MIT License
1.59k stars 324 forks source link

Xcode 12 模拟器上运行报错:Value of type 'AVMetadataMachineReadableCodeObject' has no member 'corners' #98

Open devchena opened 3 years ago

devchena commented 3 years ago
andi911 commented 3 years ago

我特么也遇到这个问题了

andi911 commented 3 years ago

屏蔽掉

vjieshao commented 3 years ago

应该增加#if !targetEnvironment(simulator)判断。真机运行是没问题的。 来源:https://developer.apple.com/forums/thread/658471 原话:This happened before and is related to how obj-c symbols are imported in Swift, not deprecation/removal of API. corners at least exists in the non-simulator SDK, so you can perhaps work-around using #if !targetEnvironment(simulator).

andi911 commented 3 years ago

应该增加#if !targetEnvironment(simulator)判断。真机运行是没问题的。 来源:https://developer.apple.com/forums/thread/658471 原话:This happened before and is related to how obj-c symbols are imported in Swift, not deprecation/removal of API. corners at least exists in the non-simulator SDK, so you can perhaps work-around using #if !targetEnvironment(simulator).

有道理,针对模拟器屏蔽掉

zzzkj commented 3 years ago

应该增加#if !targetEnvironment(simulator)判断。真机运行是没问题的。 来源:https://developer.apple.com/forums/thread/658471 原话:This happened before and is related to how obj-c symbols are imported in Swift, not deprecation/removal of API. corners at least exists in the non-simulator SDK, so you can perhaps work-around using #if !targetEnvironment(simulator).

有道理,针对模拟器屏蔽掉

image 直接这样吗?

andi911 commented 3 years ago

应该增加#if !targetEnvironment(simulator)判断。真机运行是没问题的。 来源:https://developer.apple.com/forums/thread/658471 原话:This happened before and is related to how obj-c symbols are imported in Swift, not deprecation/removal of API. corners at least exists in the non-simulator SDK, so you can perhaps work-around using #if !targetEnvironment(simulator).

有道理,针对模拟器屏蔽掉

image 直接这样吗?

看不到图片,直接针对模拟器处理代码就好,然后编辑就不会报错了

vjieshao commented 3 years ago

应该增加#if !targetEnvironment(simulator)判断。真机运行是没问题的。 来源:https://developer.apple.com/forums/thread/658471 原话:This happened before and is related to how obj-c symbols are imported in Swift, not deprecation/removal of API. corners at least exists in the non-simulator SDK, so you can perhaps work-around using #if !targetEnvironment(simulator).

有道理,针对模拟器屏蔽掉

image 直接这样吗?

是这样。

devchena commented 3 years ago

👍