I am working on an iPhone project, and have two themes defined under different directories, with most files share th开发者_如何转开发e 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
Try this:
NSString *path = [[NSBundle mainBundle] pathForResource:@"image1" ofType:@"png" inDirectory:@"group1"];
[UIImage imageWithContentsOfFile: path];
精彩评论