Reputation: 642
I'm working on an app that has a lot of assets. Most of them are .png skins for the app. I'd like to be able to organise those assets in some logical way. Currently I have them all in ASSETS\SKINS\ folder and I was wondering if there's any way to keep it that way. I mean to have that kind of folder structure so I could make skin loading automatic by listing the ASSETS\SKINS folder and assuming that all available folders contain skin definitions.
Flexibility is important here, because I'll be adding and removing skins all the time and I need to detect the available ones in runtime.
(EDIT) it's ok if all I have to do is just add the ASSETS folder the the project
What is the best way of doing this?
Upvotes: 0
Views: 3594
Reputation: 62052
You can use
[[NSBundle mainBundle] pathsForResourcesOfType:@"SOME_EXTENSION"
inDirectory:@"YOUR_DIRECTORY_PATH"];
to get an array of paths to files with the given extension.
Upvotes: 2