我正在使用 card io API 来扫描信用卡,然后将该信息用于表格视图。我必须填写以下字段:
-信用卡号 -cvv -到期日期(我附加了字符串,因为它们用作单独的变量)
这是我的代码:
.m 文件
- (void)userDidProvideCreditCardInfo:(CardIOCreditCardInfo *)info inPaymentViewController:(CardIOPaymentViewController *)scanViewController {
BillingTableViewCell *aCell;
NSString *myString = info.expiryMonth;
NSString *otherString = [myString stringByAppendingString: info.expiryYear];
aCell = (BillingTableViewCell *)[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
aCell.text.text = info.cardType;
aCell = (BillingTableViewCell *)[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:1 inSection:0]];
aCell.textLabel.text = info.cardNumber;
aCell = (BillingTableViewCell *)[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:2 inSection:0]];
aCell.text.text = info.cvv;
aCell = (BillingTableViewCell *)[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:3 inSection:0]];
aCell.text.text = info.zip;
aCell = (BillingTableViewCell *)[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:5 inSection:0]];
aCell.text.text = otherString;
[scanViewController dismissModalViewControllerAnimated:YES];
这是我的 .h 文件:
property(nonatomic, assign, readwrite) NSUInteger expiryMonth;
@property(nonatomic, assign, readwrite) NSUInteger expiryYear;
@property(nonatomic, copy, readwrite) NSString *cvv;
@property(nonatomic, copy, readwrite) NSString *zip;
我不断提出线程错误,并且信息没有放入文本字段。我究竟做错了什么?
错误:
0x38fa65c6: push.w {r3, r4}
0x38fa65ca: ldr r4, [r0] thread 1: EXC_BAD_ACCESS (code=1, address=0x5)
0x38fa65cc: lsr.w r9, r1, #2