I’ve been scratching my freaking head for an hour trying to figure out how to load an image from my application’s bundle. Doing this in Interface Builder is easy as pie, but not so straightforward.
[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@”thefilename” ofType:@”jpg”]];
Easy, isn’t it?
Thanks. You’re the first hit from “UIImage load bundle” and told me exactly what I needed.
Tom
LikeLike
Glad I could help!
LikeLike
Great stuff, spot on here too!
LikeLike
I have found that this
UIImage* I = [[UIImage imageNamed:@”image.png”] retain];
Also really works.
Tom
LikeLike
Thanks 😉
LikeLike