Mar*_*n R 11
如果你重新声明NSLog(也许也NSLogv)
void NSLog(NSString *format, ...) UNAVAILABLE_ATTRIBUTE;
void NSLogv(NSString *format, va_list args) UNAVAILABLE_ATTRIBUTE;
Run Code Online (Sandbox Code Playgroud)
在您的预编译头文件中,您收到一条很好的错误消息:
main.m:199:3: error: 'NSLog' is unavailable
NSLog(@"%@", s1);
^
您甚至可以提供自定义错误消息(可在Clang文档的已弃用和不可用属性的消息中找到):
void NSLog(NSString *format, ...) __attribute__((unavailable("You should not do this!")));
Run Code Online (Sandbox Code Playgroud)
main.m:202:3: error: 'NSLog' is unavailable: You should not do this!
NSLog(@"%@", s1);
^
| 归档时间: |
|
| 查看次数: |
243 次 |
| 最近记录: |