当我运行这个程序时,它总是显示程序接收到的信号SIGABRT。以下是我修改的代码,特别是AVAudioPlayer。我的代码有问题吗?问题是什么?下面是断点:int retVal = UIApplicationMain(argc, argv, nil, nil);
程序接收到的信号SIGABRT运行时
-(IBAction) start {
{
self.playBgMusic.enabled = YES;
[self.player play];
}
}
-(IBAction) stop {
{
self.playBgMusic.enabled = NO;
[self.player stop];
}
}
-(void) audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)completed
{
if(completed == YES){
self.playBgMusic.enabled = YES;
}
}
- (void)viewDidLoad
{
NSString *path = [[NSBundle mainBundle] pathForResource:@"music" ofType:@"mp3"];
self.player=[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
player.delegate = self;
[player play];
player.numberOfLoops = -1;
[super viewDidLoad];
}
- (void)viewDidUnload
{
[player stop];
[super viewDidUnload];
}
您应该发布有关该问题的更多信息,而不是程序本身。 SIGABRT常见,可能由许多事情引起。我怀疑你不知道什么是SIGABRT,所以你可以在这里阅读: [SIGABRT](http://en.wikipedia.org/wiki/SIGABRT)。 堆栈上的其他问题:[StackOverflow中的SIGABRT的其他主题](http://stackoverflow.com/search?q=SIGABRT)) - 可能会帮助你或至少他们肯定会帮助你。 – Rolice