I had a working iOS project, and whilst working on a git branch, the project would suddenly not load any resources from the main Bundle...I'm loading an audio file for a simple AVAudioPlayer with:
NSURL *url = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/nadamintrov1.aif", [[NSBundle mainBundle] resourcePath]]];
NSError *error;
NSLog(@"%@", url);
splashScreenAudioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:&error];
and in other ViewControllers I'm also loading other files such as:
patch = [PdBase openFile:@"klangfarbe6ep.pd" path:[[NSBundle mainBundle] resourcePath]];
if (!patch) {
NSLog(@"Failed to open patch!");
// Gracefully handle failure...
}
but whilst both those worked just fine before, now I get "couldn't initialise splash audio player" and for the patch:
open: /var/mobile/Applications/464B65AD-9E2C-42C9-8BBA-12AFD0D48393/Nadam.app/klangfarbe6ep.pd: No such file or directory
klangfarbe6ep.pd: No such file or directory 2012-02-26 12:07:17.332 Nadam[520:707] Failed to open patch!
which is weird...I mean the NSLog(@"%@", url); I put up for the AudioPlayer clearly returns:
2012-02-26 12:06:49.127 Nadam[520:707] file://localhost/var/mobile/Applications/464B65AD-9E2C-42C9-8BBA-12AFD0D48393/Nadam.app/nadamintrov1.aif
so why on earth isn't it loading it? Diff from git over the last few changes don't show anything in the project file that I can see as corruption...
anyone had that happen to them before? any way of debugging it? I read this thread:
What is the alternative of [NSBundle mainBundle] URLForResource:withExtension: in iOS 3 SDK
But can't understand why it was working before and not now with no project changes...