[[NSURL alloc] initFileURLWithPath:(NSString)] returns null
- by Ajay Pandey
NSString *soundFilePath = [[NSBundle mainBundle] pathForResource:@"Opening" ofType:@"wav"];
NSURL *fileURL = [[NSURL alloc] initFileURLWithPath: soundFilePath];
NSLog(@"@ajay");
AVAudioPlayer *audioPlayer =
[[AVAudioPlayer alloc] initWithContentsOfURL:fileURL error:nil];
[fileURL release];
[audioPlayer play];
i have inserted a wav file in my project.But
NSURL *fileURL = [[NSURL alloc] initFileURLWithPath: soundFilePath];
returns NULL and console prints following:
and application KILLS...
Can someone help me?