How can I access images that are in subfolders in XCode?

How can I access images that are in subfolders in XCode?

In Visual studio, I categoriezed all of my images in subfolders. I could then get the image for a sprite like so:

CCSprite* mySprite = CCSprite::spriteWithFile("subfolder/image.png")

When I import my code into XCode to release for Iphone, my solution breaks because it can not find the image in the subfolder.

I put all of my images and image folders in the Resources folder. I can access the iamges on the root like so:

CCSprite* mySprite = CCSprite::spriteWithFile("imageinroot.png")

But as soon as I put it in a subfolder, the game breaks.

CCSprite* mySprite = CCSprite::spriteWithFile("subfolder/image.png") // DOES NOT WORK

in Xcode, everything is eventually packed into 1 single directory. therefore, instead of

CCSprite* mySprite = CCSprite::spriteWithFile(“subfolder/image.png”)>

do this instead

CCSprite* mySprite = CCSprite::spriteWithFile(“image.png”)>

it will work

Ok. thanks.

There is a way to keep subfolder hierarchy in Resources folder.
Please refer to this link (http://www.iphonedevsdk.com/forum/iphone-sdk-development/6457-xcode-folder-directories.html).
The icons of subfolders under Resources in Project Navigator should be turned into blue instead of yellow of others.