The easiest way is to use imageNamed: as follows:
UIImage* theImage = [UIImage imageNamed:@"file1.jpg"];
If for some reason you need to use initWithContentsOfFile: you need to get the path from the package, for example:
NSString* path = [[NSBundle mainBundle] pathForResource:@"file1" ofType:@"jpg"]; UIImage* theImage = [[UIImage alloc] initWithContentsOfFile:path];
source share