我开发了一款游戏,但现在我正在尝试添加音乐。它在iPhone 3.5模拟器中工作了一次,但现在每次运行它都会崩溃。什么在这里?
NSString *music = [[NSBundle mainBundle] pathForResource:@"Intro Soundtrack" ofType:@"mp3"];
audioPlayer1 = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:music] error:NULL];
audioPlayer1.delegate = self;
audioPlayer1.numberOfLoops = -1;
[audioPlayer1 play]; // Exception breakpoint says it is this line, but what's wrong here? I don't see anything wrong.
我收到线程1:信号SIGABRT错误。
答案 0 :(得分:0)
进一步的研究表明,我在代码中删除了IBOutlets,但没有删除IB中的连接。我删除了它,它解决了这个问题。