I am using images in my iOS application.
When I test my app on iPad, Xcode return that logs:
* -[__NSCFString stringByAppendingPathExtension:]: cannot append extension 'png' to path '~iPad@2x'
What it means?
ps When I test my app on iPhone, Xcode dont return that logs.
Thank you!
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.