Loading a UIImage from a bundle

Uncategorized Add comments

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?

3 Responses to “Loading a UIImage from a bundle”

  1. Tom Schulz Says:

    Thanks. You’re the first hit from “UIImage load bundle” and told me exactly what I needed.

    Tom

  2. admin Says:

    Glad I could help!

  3. Cheese[OnToast] Says:

    Great stuff, spot on here too!

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in