Question

My iOS Phonegap app is crashing after scanning credit card using Card.io SDK.

The card does scan and does proceed to screen showing the card with the numbers overlaid. At the app crashes and throws this error in the console:

[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) 

There is a line in the CardIOPGPlugin.m file (A Card.io Phonegap plugin) that Xcode hightlights "Class method +displayStringForCardType: not found (return type defaults to 'id')":

[CardIOCreditCardInfo displayStringForCardType:info.cardType], @"card_type",

I'm building with Phonegap 2.7, iOS 6.1.3, Xcode 4.6.2, OS X 10.8.3 on an iPhone 4S device.

Was it helpful?

Solution

@Paul if you using latest card.io SDK just modify the CardIOPGPlugin.m file on line 101 from

[CardIOCreditCardInfo displayStringForCardType:info.cardType]

to

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

Hope it helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top