在 NSSound 对象上获取异常 4.3
我加载一个声音,如下所示:
sound = [[NSSound alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"alert" ofType:@"mp3"] byReference:NO];
另外,我在 xCode 中打开了“所有异常”断点。在代码继续和我的声音播放之前,上面的行连续两次抛出异常。我所看到的是代码以 Thread1: "breakpoint 4.3" 停止。
有人可以向我解释一下这里发生了什么以及 4.3 意味着什么吗?这些数字有什么参考吗?
我尝试使用 just:
sound = [NSSound soundNamed:@"alert"];
得到完全相同的结果...
谢谢。
I load a sound like so:
sound = [[NSSound alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"alert" ofType:@"mp3"] byReference:NO];
Also I have "all exceptions" break point turned on in xCode. The above line throws an exception twice in a row before the code continues and my sound plays. all i see is that the code stops with Thread1: "breakpoint 4.3"
Could someone explain to me what's going on here and what 4.3 means? is there any reference for these numbers?
I've tried to use just:
sound = [NSSound soundNamed:@"alert"];
with exactly the same result...
thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是第一个注意到系统声音这个问题的人......我在 Xcode 中与 iPhone (iOS) 的系统声音遇到同样的问题。如果我打开“所有异常”断点,我会收到与您相同的消息。我今天为此发疯了……但可能是苹果的问题,无论如何也许并不危险……
有什么方法可以从 Xcode 中的“所有异常”中禁用此异常吗?
...如果您在选项中仅启用“Objective-C”的例外,您将不会再收到此消息。这意味着它是一个C++异常(更多与苹果/框架相关)。
You are the first who noticed this problem with the System Sound…. I have the same issue in Xcode with the System Sound of the iPhone (iOS). If I turn on the "all exceptions" break point I get the same message you have. I went crazy today with this…. but probably is an Apple's issue and anyway is not dangerous maybe…..
Is there any way to disable this exception from "all exceptions" in Xcode?
… well if you enable exceptions only for "Objective-C" in the options, you do not get this message anymore. It mean that it is a C++ exception (more apple / framework related).