Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 在设备上触发断点,但在模拟器上不触发断点_Objective C_Xcode_Debugging_Breakpoints_Ios Simulator - Fatal编程技术网

Objective c 在设备上触发断点,但在模拟器上不触发断点

Objective c 在设备上触发断点,但在模拟器上不触发断点,objective-c,xcode,debugging,breakpoints,ios-simulator,Objective C,Xcode,Debugging,Breakpoints,Ios Simulator,我有一个奇怪的情况,Xcode在实际的iPhone设备上运行时只捕获断点,而不是在模拟器上 -(IBAction)ping1:(id)sender { // this is the break point NSString *path = [[NSBundle mainBundle] pathForResource:@"dontforgetme" ofType:@"mp3"]; AVAudioPlayer *sound = [[AVAudioPlayer alloc] i

我有一个奇怪的情况,Xcode在实际的iPhone设备上运行时只捕获断点,而不是在模拟器上

-(IBAction)ping1:(id)sender
{
    // this is the break point
    NSString *path = [[NSBundle mainBundle] pathForResource:@"dontforgetme" ofType:@"mp3"];
    AVAudioPlayer *sound = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
   [sound play];
}
另一个问题是,当按下按钮时,会调用
ping1
,声音会播放,但即使MP3文件有3分钟长的声音,也只能播放一秒钟或更短的时间

我一点都不明白。这怎么可能发生?我怎样才能找到问题