Cocoa Dev
Cocoa Dev

Reputation: 9551

DebugLog Format string is not a string literal

My code looks like

DebugLog(urlStr);

urlStr is an NSString but I keep getting a warning saying

Format string is not a string literal

I got this code from a website.

#ifdef DEBUG
#define DebugLog(s, ...) NSLog(s, ##__VA_ARGS__)
#else
#define DebugLog(s, ...)
#endif

Upvotes: 0

Views: 969

Answers (1)

Snowman
Snowman

Reputation: 32091

Try this: DebugLog(@"%@", urlStr);

Upvotes: 3

Related Questions