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?
Tom Schulz
Thanks. You’re the first hit from “UIImage load bundle” and told me exactly what I needed.
Tom
admin
Glad I could help!
Cheese[OnToast]
Great stuff, spot on here too!
Tom Schulz
I have found that this
UIImage* I = [[UIImage imageNamed:@”image.png”] retain];
Also really works.
Tom
objective-c
Thanks 😉