Hi, I'm developing a iPhone app, but I ran into a snag.
NSString *fileLocation = [[NSBundle mainBundle] pathForResource:@"happy.1" ofType:@"jpg"];
UIImage *new_image = [UIImage imageWithContentsOfFile:fileLocation];
[self setImage:new_image];
if (new_image == nil) {
NSLog(@"can't load image happy.1.jpg");
}
bgImageView.image = image;
That's the code I'm using to show an image, but it doesn't appear! new_image isn't nil, which I understand it would be if it couldn't load the image. bgImageView is an IBOutlet and connected in IB.
Please tell me what I'm doing wrong. Thanks!
Edit: also, this does not work on the simulator nor device