I have the following line of code in a Mac OS X application:
NSLog(@"number of items: %ld", [urlArray count]);
And I get a warning: "The format sets the type to" long ", but the argument is of the type" NSUInteger "(aka" unsigned int ")"
However, if I change my code to:
NSLog(@"number of items: %u", [urlArray count]);
I get a warning:
The format defines the type "unsigned int", but the argument is of the type "NSUInteger" (aka "unsigned long")
So, I change it to
NSLog(@"number of items: %u", [urlArray count]);
but I get a warning: The format sets the type to "unsigned long", but the argument is of type "NSUInteger" (aka "unsigned int")
How can I configure my NSLog so that it does not generate a warning? If I follow the Xcode guidelines, I’ll just go in for an endless cycle of changing the format specifier, but the warnings will never disappear.
Jackson
source share