UIAlertViewがオフになるので、私はそのような質問をしています。AVAudioPlayerではありません。これが私のコードです:
- (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region
{
NSLog(@"MapViewController - didEnterRegion");
LocationReminder *theLocationReminder = [self.locationReminders objectForKey:region.identifier];
NSError *error;
NSURL *theUrl = [NSURL URLWithString:theLocationReminder.audioURI];
NSLog(@"theUrl = %@",theUrl);
AVAudioPlayer *thePlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:theUrl error:&error];
NSLog(@"thePlayer.url = %@",thePlayer.url);
[thePlayer play];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"entered region..." message:@"You have Entered the Location." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];
alert.tag = 2;
[alert show];
}
テスト後にデバイスのログを確認しました。テストを行っているときにアラートビューが実際に表示されますが、正しいURLを使用していてもAVAudioPlayerは再生されません。
[必須のバックグラウンドモード]でplistのオーディオを有効にしましたが、まだアプリを使用しています(したがって、バックグラウンドは問題になりません)。