Objectif c ERREUR: types incompatibles pour l'argument 2 de 'NSRunAlertPanel'
-
02-10-2019 - |
Question
Voici le code:
float charlieSoundVolume;
charlieSoundVolume = [charlieSoundLevel floatValue];
NSRunAlertPanel(@"CHARLIE",charlieSoundVolume, @"", @"", @"Ok");
Cela me donne l'erreur: types incompatibles pour l'argument 2 de 'NSRunAlertPanel'
Will NSRunAlertPanel pas accepter flotte?
Toutes les idées ??
Elijah
La solution
Je ne sais pas pourquoi vous seriez surpris de voir qu'il ne prend pas flotte compte tenu de la documentation:
NSInteger NSRunAlertPanel (
NSString *title,
NSString *msg,
NSString *defaultButton,
NSString *alternateButton,
NSString *otherButton,
...
);
Passez une chaîne.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow