我想通过运行带有 URL 的数组来添加多个存折传递。问题是循环计数比视图控制器可以呈现的快。这是我的代码:
NSArray *passURLArray = [NSArray new];
passURLArray = response;
for (int i = 0; passURLArray.count; i++) {
NSString *passURLString = [NSString stringWithFormat:@"http://test.de%@", [passURLArray objectAtIndex:i]];
NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:passURLString]];
NSError *error;
PKPass *pass = [[PKPass alloc] initWithData:data error:&error];
[[UIApplication sharedApplication] openURL:[pass passURL]];
PKAddPassesViewController *passVC = [[PKAddPassesViewController alloc] initWithPass:pass];
passVC.delegate = self;
[passVC setDelegate:(id)self];
[self presentViewController:passVC animated:YES completion:nil];
}
我收到此错误消息:
尝试在 PaymentViewController: 0x14882290 上呈现 PKAddPassesViewController: 0xca5f7d0 正在等待 PKAddPassesViewController: 0xb169470 的延迟呈现完成
提前致谢。