iPod running 4.2 background image has slight error, when iPhone simulator 4.2 is fine
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...
精彩评论