简体   繁体   中英

Images not displayin on newer iPad devices like iPad Air, iPad3 but displaying on simulator iOS 8.1

I am working on app that runs only on iPad. Images from 'Resources' folder are not being displayed on newer generation iPad's and iPad Air but they are displaying fine when iPad Air is selected as target on Xcode Simulator. We have both @1x (Image size: 14*14) and @2x (Image size: 28*28) images in the project.

Also, I checked the files names and they match. Any help or suggestions would be appreciated. Thanks a lot

Please find the code below:

@property (nonatomic, weak) UIButton *expandAllButton;

self.expandAllButton = [UIButton buttonWithType:UIButtonTypeCustom];
self.expandAllButton.frame = CGRectMake(10, 10, 32, 44);
[self.expandAllButton setImage:[UIImage imageNamed:@"ExpandAll.png"] forState:UIControlStateNormal];

EDIT: If anyone facing the same problem, I solved it by changing the button to strong reference from weak reference. We had it weak reference when we had IBOutlet to the button but later we removed it and forgot to change it to strong reference.

@property (nonatomic, strong) UIButton *expandAllButton;

It seems like 64bit device issue. New device mentioned by you are 64bit devices.

Some other user have also same problem for 64 bit devices. Some images are not displaying from bundle in 64-bit device though implemented correctly.

You may check this SO Answer . It may solve your problem.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM