I'm currently using NSRunAlertPanel
to display a dialog.
It works perfectly in Leopard and Snow Leopard. In Tiger,开发者_如何学JAVA 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.
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.
精彩评论