[existingInstances setObject:classInstances forKey:self]; <- incompatible pointer types sending 'Class' to parameter of type 'id<NSCopying>'
[windowTransitions setObject:transition forKey:[transition class]]; <- incompatible pointer types sending 'Class' (aka 'Class *')to parameter of type 'id<NSCopying>'
and
MailMe - GrowlMailMeDisplay.m
NSString *userAtHostPort = [NSString stringWithFormat:
(port != nil) ? @"%@@%@:%@" : @"%@@%@",
username, hostname, port]; <- Data argument not used by format string
Anyone give me any pointers as to what is wrong?
cheers
Matt
Same here. I got so many warnings and errors while building this on ML using Xcode 4.4 but I finally built it successfully after some debugging. I don't get the same error in Growl.app, you may want to re-clone or update again to 1.4 tag. For MailMe, I just edited:
NSString *userAtHostPort = [NSString stringWithFormat:
(port != nil) ? @"%@@%@:%@" : @"%@@%@", <-this part, I'm not an expert so I can't tell what should be done but from what I can tell the format string must match the number of arguments below?
username, hostname, port]; <- Data argument not used by format string
For other errors I got such as Format String Errors, I just changed them to what was suggested.
That line is a bit of cleverness that creates a string like the following:
m...@my-other-machine.local:4000 (if a port is specified)
m...@my-other-machine.local (if no port)
The middle expression chooses between two format strings (@"…"). The first one requires three arguments (each represented by “%@”); the second requires two.
It's not, strictly speaking, an error to pass more arguments than the format string requires, but it can be caused by changing either the format string or the argument list (in this line, that's “username, hostname, port”) and forgetting to change the other.
The cleverness here is in *deliberately* passing more arguments than the second format string requires, since the first format string will use all three and the second format will simply ignore the extra argument.
The code is correct, but the compiler is not wrong, and ignoring warnings is a good way to create problems later—if somebody makes the aforementioned change-one-but-not-the-other mistake in a later change, the warning will not suddenly appear because it was already there, so the person making the change may not discover their mistake.
Something like this?