views:

28

answers:

1

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

+2  A: 

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.

bbum
Yes, I understand. Can you show an example? Thanks for your help and fast response!
Elijah W.
Better yet, I can show you how to answer it yourself. Read this document: http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Strings/introStrings.html
bbum
Great! thanks! I'll check that out
Elijah W.