我在我的 iOS 应用程序中使用图像。
当我在 iPad 上测试我的应用程序时,Xcode 返回该日志:
* -[__NSCFString stringByAppendingPathExtension:]: 无法将扩展名 'png' 附加到路径 '~iPad@2x'
这是什么意思?
ps 当我在 iPhone 上测试我的应用程序时,Xcode 不会返回该日志。
谢谢!
If you are checking for if Device is iPad and then set the image by appending "@2x" then Dont. Just use image name without '@2x'. This might solve your problem.
Like if you are setting an image for iPhone UI like
UIImageView * imageView = [UIImageView alloc] init];
[imageView setImage[UIImage imageNamed:@"image.png"]];
And for iPad you are doing this:
[imageView setImage[UIImage imageNamed:@"image@2x.png"]];
Then this might be the problem. Dont append @2x.