Вот мой код:
NSError *error;
NSString* path = [[NSBundle mainBundle] pathForResource:[settings alarmAudioName] ofType:@"mp3"];
NSLog(@"%@",path);
audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
NSLog(@"%@",[NSURL fileURLWithPath:path]);
if (audioPlayer == nil)
NSLog(@"%@", [error description]);
else
{
[audioPlayer prepareToPlay];
[audioPlayer play];
NSLog(@"Should have been played");
}
NSLog:
/var/mobile/Applications/9B5B4E10-A936-4D90-8CBE-17854A0B22F7/SSCA Development.app/Song 1.mp3
file://localhost/var/mobile/Applications/9B5B4E10-A936-4D90-8CBE-17854A0B22F7/SSCA%20Development.app/Song%201.mp3
Он работает правильно в Ipod Touch 4g, но не работает в Ipad, Ipad2, почему?
Спасибо за ответы,