[問題] 背景音樂問題
我用AVFoundation寫背景音樂
程式碼如下
-(void)play{
NSURL *url = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/MUSIC.wav"
,[[NSBundle mainBundle] resourcePath]]];
NSError *error;
audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:&error];
audioPlayer.numberOfLoops= 1;
[audioPlayer play];
但run了之後卻出現Failed
以及以下訊息:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_AVAudioPlayer", referenced from:
objc-class-ref in single_nameViewCintroller.o
google找了很多跟我打的都是一樣的
是哪裡出了什麼問題麻煩大家替我解答一下
謝謝!!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.33.77.78
推
09/25 08:38, , 1F
09/25 08:38, 1F
→
09/25 18:20, , 2F
09/25 18:20, 2F
→
09/25 18:21, , 3F
09/25 18:21, 3F
→
10/10 13:14, , 4F
10/10 13:14, 4F
→
10/10 13:15, , 5F
10/10 13:15, 5F
→
10/10 13:15, , 6F
10/10 13:15, 6F