NSRunAlertPanel 不适用于 Tiger,但适用于 Leopard 和 Snow Leopard

发布于 2024-08-24 16:46:08 字数 408 浏览 2 评论 0原文

我目前正在使用 NSRunAlertPanel 来显示对话框。

它在 Leopard 和 Snow Leopard 中完美运行。在 Tiger 中,除了图标之外它也有效。

在 Leopard 和 Snow Leopard 中,我用于应用程序的图标显示在字符串的左侧。这是预期的行为。

然而,在 Tiger 中,琴弦的左侧有一个很大的空白,图标丢失了,但图标的间隙却存在。

这是我使用代码的方式:

NSRunAlertPanel(@"My Application", @"My Application's string contents", @"OK", nil, nil);

我真的需要知道为什么会发生这种情况。我没有添加任何代码让图标出现在豹纹和雪花中,但它就在那里。

I'm currently using NSRunAlertPanel to display a dialog.

It works perfectly in Leopard and Snow Leopard. In Tiger, it also works except for the icon.

In Leopard and Snow Leopard, the icon I used for the App is displayed on the left side of the strings. This is the expected behavior.

However, in Tiger, there is a big margin on the left side of the strings, the icon is missing but the gap for the icon is there.

Here's how i used the code:

NSRunAlertPanel(@"My Application", @"My Application's string contents", @"OK", nil, nil);

I really need to know why this happens. I did not add any code for the icon to appear in leopard and snow, but it's there.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

江湖正好 2024-08-31 16:46:08

NSRunAlertPanel 函数从 Mac OS X 10.0 开始可用。我在您的代码中看到的唯一问题是您将 C 字符串传递给需要 NSString 对象的函数。

The NSRunAlertPanel function is available starting from Mac OS X 10.0. The only problem I can see in your code is that you are passing C strings to the function where NSString objects are expected.

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