开发者

iPod running 4.2 background image has slight error, when iPhone simulator 4.2 is fine

开发者 https://www.devze.com 2023-03-31 00:34 出处:网络
I have an interesting problem. My app runs fine on the iphone 4.2 simulator, everything works as i expect. However when I put it onto my ipod to test it out it seems to have one slight background imag

I have an interesting problem. My app runs fine on the iphone 4.2 simulator, everything works as i expect. However when I put it onto my ipod to test it out it seems to have one slight background image problem.

开发者_开发百科

The background that i have loaded in using interface builder displays correctly, however, when I try to run this code, the ipod does not display it...

UIImage *img = [UIImage imageNamed:@"v3_default_bg.png"];
UIImageView *bgView = [[UIImageView alloc] initWithFrame:self.view.frame];
bgView.image = img;
[appDelegate.navigationController.view addSubview:bgView];
[appDelegate.navigationController.view sendSubviewToBack:bgView];

Could anyone shed some light on this for me? that would be really great! Thanks.

edit

Actually I have found that the uiimage is returning null on only iOS devices. On the simulator it works just fine. Any ideas?


You might check the Copy Bundle Resources settings under your target -> Build phases -> last section 'Copy Bundle Resources' is there an entry for the image? If not you need to create one by clicking the '+' button and select your image. Or check the case sensitivity. iPhone simulator does ignore the cases - the device does NOT! Same as in this question cell.imageView is working on Simulator but not on Device.


Found it. It turns out that on the simulator, image names are not case sensitive. But on devices they are...

0

精彩评论

暂无评论...
验证码 换一张
取 消