我有以下代码在品牌上显示图像,但出现 UIImageView 错误。我调整了大小为 800x600 的图像以适合 iPhone 屏幕的大小。
NSURL * url = [NSURL URLWithString:@"http://www.portallzc.com/galerias/galeria_Portal%20de%20Lazaro%20Cardenas/Club%2033/800/p16jklq9uj1f7a1c6tckkjrg1i8015.JPG"];
NSData * urlData = [NSData dataWithContentsOfURL: url];
UIImage * image = [UIImage imageWithData: urlData];
CGRect rect = CGRectMake (0.0f, 40.0f, image.size.width, image.size.height);
image = [[UIImageView alloc] initWithFrame: rect];
[setImage image: image];
错误:由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“- [UIImageView _isResizable]:无法识别的选择器实例 stmt 为 0x6b8bb70”