NSRunAlertPanel 不适用于 Tiger,但适用于 Leopard 和 Snow Leopard
我目前正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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 whereNSString
objects are expected.