在 NSSound 对象上获取异常 4.3

发布于 2024-12-19 03:33:20 字数 444 浏览 6 评论 0原文

我加载一个声音,如下所示:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

も让我眼熟你 2024-12-26 03:33:20

您是第一个注意到系统声音这个问题的人......我在 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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文