0

使用 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 (return type defaults to '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 进行构建。

4

1 回答 1

2

@Paul 如果您使用最新的 card.io SDK,只需修改第 101 行的 CardIOPGPlugin.m 文件

[CardIOCreditCardInfo displayStringForCardType:info.cardType]

[CardIOCreditCardInfo displayStringForCardType:info.cardType usingLanguageOrLocale:[[NSLocale currentLocale] localeIdentifier]]

希望能帮助到你。

于 2013-06-11T01:10:10.727 回答