How to load images from a specific group?
In Xcode4, I use groups for grouping my stuff, for example I have a tree like group hierarchy for my various images. The interesting 开发者_如何学Pythonpart is that I can access an image directly without specifying a group.
UIImage *img = [UIImage imageWithName:@"image1.png"];
I have two questions. First, how to define concrete path of groups where resides all needed images (for example for the group tree "Img/Enemy/")? And a second, how to iterate through that group path to load all the images from that group? IMHO groups are related to bundles but I found them very confusing :(
When you use groups, you are not actually creating folders, so when you build your app everything is put at the root of the bundle. This is why you can access them without specifying the group name. If you want to use folders, you can create folders in Finder and add them to the project (make sure to check "create folder references for any added folders"!).
Groups are only used to organize file within Xcode; they are not really of any use outside of Xcode, nor does Xcode copy them over to the final app.
You need to use folder references instead of groups to do what you want.
精彩评论