Objective c ERROR:'NSRunAlertPanel'参数2的不兼容类型

时间:2010-07-04 03:14:26

标签: objective-c xcode floating-point nsrunalertpanel

以下是代码:

float charlieSoundVolume;
charlieSoundVolume = [charlieSoundLevel floatValue];

NSRunAlertPanel(@"CHARLIE",charlieSoundVolume, @"", @"", @"Ok");

这给了我错误: “NSRunAlertPanel”

的参数2的不兼容类型

NSRunAlertPanel会不接受花车吗?

任何想法??

利亚

1 个答案:

答案 0 :(得分:2)

我不确定为什么你会惊讶于它没有给出文件中的花车:

NSInteger NSRunAlertPanel (
   NSString *title,
   NSString *msg,
   NSString *defaultButton,
   NSString *alternateButton,
   NSString *otherButton,
   ...
);

传递一个字符串。