本文介绍了DebugLog Format字符串不是字符串文字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的代码看起来像
DebugLog(urlStr);urlStr是一个NSString ,但我不断收到一条警告说
格式字符串不是字符串字面值我从一个网站得到这个代码。
#ifdef DEBUG #define DebugLog(s,。 ..)NSLog(s,## __ VA_ARGS__) #else #define DebugLog(s,...) #endif pre> 解决方案尝试这样: DebugLog(@%@,urlStr);
My code looks like
DebugLog(urlStr);urlStr is an NSString but I keep getting a warning saying
Format string is not a string literalI got this code from a website.
#ifdef DEBUG #define DebugLog(s, ...) NSLog(s, ##__VA_ARGS__) #else #define DebugLog(s, ...) #endif解决方案
Try this: DebugLog(@"%@", urlStr);
更多推荐
DebugLog Format字符串不是字符串文字
发布评论