Anyone:
I want to use one macro to print log, following,
#define isaObject(parameter) _Generic((parameter), id: YES, id __strong: YES, default: NO)
#define kNSLog(parameter) do \
{ \
BOOL is = isaObject((parameter)); \
if (is) \
{ \
NSLog(@"----Yes : %@", parameter); \
} \
else \
{ \
NSLog(@"----No : %d", parameter); \
} \
} while (NO)
int i = 99;
NSString * s = @"abcd";
kNSLog(i);
kNSLog(s);
Then, the Compiler gave the warning "Format specifies type 'int' but the argument has type 'NSString *'".
How to modify, Please?