views:

39

answers:

2

Hey all, I have a selector that searches the mainBundle for all .aif files, and allows the user to select them. This works fine, but then I removed some of the files from the project and folder, yet they did not disappear. Is there any way to maybe recompile it or something because It's now plagued with sound files that I don't need.

Thanks!

- (void)loadPossibleSounds {
    NSBundle *soundBundle = [NSBundle mainBundle];
    possDrumSounds = [soundBundle pathsForResourcesOfType:@"aif" inDirectory:nil];
    NSLog(@"PossDrumSounds: %@", possDrumSounds);
    [possDrumSounds retain];
}

The above is the code that I use to get an array (possDrumSounds) full of all .aif file paths. Looking at it again, it may have to do with the fact that I said inDirectory:nil, but that shouldn't matter.

+1  A: 

Try cleaning your target and re-building.

Joshua Nozzi
I did clean all targets and it didn't work. What happened originally, was that I renamed the sound files and was moving stuff around. So in the optional list it shows snare.aif and d.aif being the same thing.
XenElement
I'm a little confused. If your code lists only files available in your bundle's resources, how can it show the files if they're not there? You may need to post your code. What does the target's app bundle's resources folder look like? Have you explored it in Finder?
Joshua Nozzi
I've explored it in finder, I've deleted all resource references and re added them. I'm editing my question to include the code.
XenElement
Hmm. Which build mode are you in (Release, Debug, etc.) and are you looking at the built target's bundle for that build mode in Finder?
Joshua Nozzi
In finder I have only looked in the folder for the project. I wasn't sure where else to look.
XenElement
A: 

Interestingly, this has been resolved. It appears that for some reason xcode and the iphone simulator retain all of the resources in the bundle. (At least in my case). This was remedied when I tested it on the device which did not have all of the extra sounds.

XenElement
...that's what I meant when I suggested looking inside the app bundle. :-)
Joshua Nozzi
Ah, then you were right! :D
XenElement