문제

Here is the code:

float charlieSoundVolume;
charlieSoundVolume = [charlieSoundLevel floatValue];

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

This gives me the error: incompatible 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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top