我正在使用wildabeast barcode reader Cordova插件读取一些VIN条形码。
这在Android和iOS 7上运行良好,但自从更新到Xcode 6和iOS 8后,我无法编译处理条形码的代码。我认为这是一个配置问题,但我对iOS或Xcode没有多少经验。
以下是我收到的错误的一部分:
/platforms/ios/project/Plugins /com.phonegap.plugins.barcodescanner/CDVBarcodeScanner.mm:152:16: 'retain' is unavailable: not available in automatic reference counting mode
/platforms/ios/project/Plugins /com.phonegap.plugins.barcodescanner/CDVBarcodeScanner.mm:152:16: ARC forbids explicit message send of 'retain'
/platforms/ios/project/Plugins/com.phonegap.plugins.barcodescanner/CDVBarcodeScanner.mm:153:16: 'retain' is unavailable: not available in automatic reference counting mode
/platforms/ios/project/Plugins/com.phonegap.plugins.barcodescanner/CDVBarcodeScanner.mm:153:16: ARC forbids explicit message send of 'retain'
/platforms/ios/project/Plugins/com.phonegap.plugins.barcodescanner/CDVBarcodeScanner.mm:154:16: 'retain' is unavailable: not available in automatic reference counting mode
/platforms/ios/project/Plugins/com.phonegap.plugins.barcodescanner/CDVBarcodeScanner.mm:154:16: ARC forbids explicit message send of 'retain'
/platforms/ios/project/Plugins/com.phonegap.plugins.barcodescanner/CDVBarcodeScanner.mm:168:75: ARC forbids explicit message send of 'autorelease'
/platforms/ios/project/Plugins/com.phonegap.plugins.barcodescanner/CDVBarcodeScanner.mm:168:75: 'autorelease' is unavailable: not available in automatic reference counting mode
/platforms/ios/project/Plugins/com.phonegap.plugins.barcodescanner/CDVBarcodeScanner.mm:246:12: ARC forbids explicit message send of 'dealloc'
/platforms/ios/project/Plugins/com.phonegap.plugins.barcodescanner/CDVBarcodeScanner.mm:260:118: 'autorelease' is unavailable: not available in automatic reference counting mode
/platforms/ios/project/Plugins/com.phonegap.plugins.barcodescanner/CDVBarcodeScanner.mm:260:118: ARC forbids explicit message send of 'autorelease'
/platforms/ios/project/Plugins/com.phonegap.plugins.barcodescanner/CDVBarcodeScanner.mm:271:6: 'presentModalViewController:animated:' is deprecated: first deprecated in iOS 6.0
/platforms/ios/project/Plugins/com.phonegap.plugins.barcodescanner/CDVBarcodeScanner.mm:280:32: 'dismissModalViewControllerAnimated:' is deprecated: first deprecated in iOS 6.0
/platforms/ios/project/Plugins/com.phonegap.plugins.barcodescanner/CDVBarcodeScanner.mm:287:27: ARC forbids use of 'release' in a @selector
/platforms/ios/project/Plugins/com.phonegap.plugins.barcodescanner/CDVBarcodeScanner.mm:324:73: ARC forbids explicit message send of 'autorelease'
/platforms/ios/project/Plugins/com.phonegap.plugins.barcodescanner/CDVBarcodeScanner.mm:324:73: 'autorelease' is unavailable: not available in automatic reference counting mode
/platforms/ios/project/Plugins/com.phonegap.plugins.barcodescanner/CDVBarcodeScanner.mm:346:81: ARC forbids explicit message send of 'autorelease'
/platforms/ios/project/Plugins/com.phonegap.plugins.barcodescanner/CDVBarcodeScanner.mm:346:81: 'autorelease' is unavailable: not available in automatic reference counting mode
/platforms/ios/project/Plugins/com.phonegap.plugins.barcodescanner/CDVBarcodeScanner.mm:451:110: ARC forbids explicit message send of 'autorelease'
/platforms/ios/project/Plugins/com.phonegap.plugins.barcodescanner/CDVBarcodeScanner.mm:451:110: 'autorelease' is unavailable: not available in automatic reference counting mode
/platforms/ios/project/Plugins/com.phonegap.plugins.barcodescanner/CDVBarcodeScanner.mm:621:70: ARC forbids explicit message send of 'autorelease'
答案 0 :(得分:1)
您应该将-fno-objc-arc
添加到Build Phases> CompileSources> CDVBarcodeScanner.mm
本文将帮助ARC: Setting compiler flags to -fno-objc-arc and build errors
答案 1 :(得分:0)
这个插件有很多问题,我已经发送过这种问题,而不是回复。
https://github.com/wildabeast/BarcodeScanner/issues/183
尝试使用scandit代替Cordova条形码阅读器。
答案 2 :(得分:0)
我通过从文件中删除所有内存管理代码来修复它。我也错过了一些库,所以我也添加了它们。
这个问题也有帮助: Objective-C: ARC forbids explicit message send of 'retain'