当NSLog要求打印空字符串时,它将完全省略日志。
NSString *name = @""; NSLog(@"%@", name); // Resolves to @""
上面的代码将不会打印任何内容。
为日志添加标签是一个好习惯:
NSString *name = @""; NSLog(@"Name: %@", name); // Resolves to @"Name: "
上面的代码将打印:
2016-07-21 14:20:28.623 App[87711:6153103] Name:
友情链接: json在线解析 通晓查询 糯晒黄历 姓名打分