弹出视图控制器时应用程序崩溃
您的图片可能已经通过Apple的pngcrush程序运行,因此不再是有效的PNG文件。我被告知Apple的pngcrush有一种方法可以恢复损坏并从压缩的文件中重新创建一个有效的PNG,可能会丢失一些数据。如果您可以查看文件的开头并且字节CgBI从字节12开始而不是IHDR,那将确认该文件确实已经被苹果pngcrushed。
Your images have probably been run through Apple's "pngcrush" program and therefore are not valid PNG files any more. I'm told that Apple's "pngcrush" has a way of reverting the damage and recreating a valid PNG from the crushed file, perhaps with some loss of data. If you can look at the beginning of the file and the bytes "CgBI" appear starting at byte 12 instead of "IHDR", that will confirm that the file has indeed been apple-pngcrushed.
啊!
@vivek,而不是这一行:
@vivek, instead of this line:
[self.navigationController pushViewController:paymentViewController.visibleViewController animated:NO];
[self.navigationController pushViewController:paymentViewController.visibleViewController animated:NO];
尝试这个(根据我们的示例代码):
try this one (as per our sample code):
[self presentViewController:paymentViewController animated:YES completion:nil];
[self presentViewController:paymentViewController animated:YES completion:nil];
而且,而不是这一个:
[self.navigationController popToRootViewControllerAnimated:YES];
[self.navigationController popToRootViewControllerAnimated:YES ];
使用此:
[self dismissViewControllerAnimated:YES com pletion:nil];
[self dismissViewControllerAnimated:YES completion:nil];