I've come across a rather weird issue with stringWithFormat:
. I create a string and assign it to an alert panel.
For some reason though, Xcode says that the format string isn't a string literal even though it is? Can anyone shed some light?
Header declaration:
APPKIT_EXTERN void NSBeginCriticalAlertSheet(NSString *title, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, NSWindow *docWindow, id modalDelegate, SEL didEndSelector, SEL didDismissSelector, void *contextInfo, NSString *msgFormat, ...) NS_FORMAT_FUNCTION(10,11);
Edit: Looking at the header declaration, it came to me. I was missing a nil
after the msgFormat
variable. Xcode's warning was confusing though - it should have been missing sentinel in function call
instead.