-1
사용자가 컬렉션보기 사용자 정의 셀을 선택하면 mp3 파일을 재생하고 싶습니다. 하지만 그것은 재생되지 않습니다. (UICollectionView *) collectionView didSelectItemAtIndexPath : 한 번 (NSIndexPath *) indexPath {iOS에서 uicollectionviewcell을 클릭하면 오디오 재생
NSLog(@"cell selected ");
AVAudioPlayer * audioPlayer;
NSString *path = [[NSBundle mainBundle] pathForResource:@"bismillah" ofType:@"mp3"];
NSURL *audioUrl=[NSURL fileURLWithPath:path];
audioPlayer=[[AVAudioPlayer alloc] initWithContentsOfURL:audioUrl error:nil];
//audioPlayer.delegate=self;
[audioPlayer play];
// cell.backgroundColor = [UIColor blueColor];
}
아직 작동하지 않습니다 ... 컬렉션보기 셀을 선택하면 오디오를 재생하는 데 필요한 단계를 나열 해주십시오. – atti
번들 리소스 파일을 체크 했습니까? – Balu
예. bismillah.mp3이 내 프로젝트 폴더에 있습니다. – atti