tags:

views:

21

answers:

1

Hi,

I am working on an iPhone project, and have two themes defined under different directories, with most files share the same names (like background.png, image1.png, image2.png, etc). I have had them imported into xcode under different group names (group1, group2).

How do I tell UIImage to load an image from a given group, say, I want group1:background.png?

Thanks, Tim

A: 

Try this:

NSString *path = [[NSBundle mainBundle] pathForResource:@"image1" ofType:@"png" inDirectory:@"group1"];
[UIImage imageWithContentsOfFile: path];
MihaiD