使用Card.io SDK扫描信用卡后,我的iOS Phonegap应用程序崩溃了。
卡片会扫描并继续显示屏幕,显示数字重叠的卡片。在应用程序崩溃并在控制台中抛出此错误:
[CardIOCreditCardInfo displayStringForCardType:]: unrecognized selector sent to class 0x271c88
2013-06-09 23:33:37.767 Cardio_HolaWorld[49544:907] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[CardIOCreditCardInfo displayStringForCardType:]: unrecognized selector sent to class 0x271c88'
*** First throw call stack:
(0x331312a3 0x3ae5997f 0x33134ca3 0x33133531 0x3308af68 0xb6479 0x13a5e7 0x350240c5 0x3502414d 0x350240c5 0x35024077 0x35024055 0x3502390b 0x35023e01 0x34f4c5f1 0x34f39801 0x34f3911b 0x36c515a3 0x36c511d3 0x33106173 0x33106117 0x33104f99 0x33077ebd 0x33077d49 0x36c502eb 0x34f8d301 0xb4f5f 0xb4f20)
libc++abi.dylib: terminate called throwing an exception
(lldb)
CardIOPGPlugin.m文件中有一行(A Card.io Phonegap插件),Xcode高亮显示“Class method + displayStringForCardType:not found(返回类型默认为'id')”:
[CardIOCreditCardInfo displayStringForCardType:info.cardType], @"card_type",
我正在iPhone 4S设备上使用Phonegap 2.7,iOS 6.1.3,Xcode 4.6.2,OS X 10.8.3构建。
答案 0 :(得分:2)
@Paul如果您使用最新的card.io SDK,只需修改第101行的CardIOPGPlugin.m文件
[CardIOCreditCardInfo displayStringForCardType:info.cardType]
到
[CardIOCreditCardInfo displayStringForCardType:info.cardType usingLanguageOrLocale:[[NSLocale currentLocale] localeIdentifier]]
希望它有所帮助。