开发者

Objective c ERROR: incompatible types for argument 2 of 'NSRunAlertPanel'

开发者 https://www.devze.com 2023-01-05 10:34 出处:网络
Here is the code: float charlieSoundVolume; charlieSoundVolume = [charlieSoundLevel floatValue]; NSRunAlertPanel(@\"CHARLIE\",charlieSoundVolume, @\"\", @\"\", @\"Ok\");

Here is the code:

float charlieSoundVolume;
charlieSoundVolume = [charlieSoundLevel floatValue];

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

This gives me the error: incompa开发者_高级运维tible types for argument 2 of 'NSRunAlertPanel'

Will NSRunAlertPanel not accept floats?

Any ideas??

Elijah


I'm not sure why you'd be surprised that it doesn't take floats given the documentation:

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

Pass a string.

0

精彩评论

暂无评论...
验证码 换一张
取 消