我的 iOS Phonegap 应用程序在使用 Card.io SDK 扫描信用卡后崩溃。
卡片确实进行了扫描,并继续显示卡片上覆盖了数字的屏幕。在应用程序崩溃并在控制台中抛出此错误时:
[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 文件(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 进行构建。
最佳答案
@Paul 如果您使用最新的 card.io SDK,只需修改第 101 行的 CardIOPGPlugin.m 文件
[CardIOCreditCardInfo displayStringForCardType:info.cardType]
到
[CardIOCreditCardInfo displayStringForCardType:info.cardType usingLanguageOrLocale:[[NSLocale currentLocale] localeIdentifier]]
希望对您有所帮助。
关于Card.io 扫描信用卡后,iOS Phonegap 应用程序崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17017197/