把字典转成json字符串
[[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:dic options:NSJSONWritingPrettyPrinted error:nil] encoding:4]
当使用控制台filter时,如果通过标识字符过滤时,数组以及字典都只能看到一行
通过下面的方式解决
NSLog(@"+++删除图形 %@",[[NSMutableString stringWithFormat:@"%@", dataArray] stringByReplacingOccurrencesOfString:@"\n" withString:@"_"]);
条件断点,编辑
po [NSString stringWithFormat:@"+++ %@", [[[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:dic options:NSJSONWritingPrettyPrinted error:nil] encoding:4] stringByReplacingOccurrencesOfString:@"\n" withString:@"_"]]
保证打印出一行
Swift 字典打印成字符串
po NSString(data: JSONSerialization.data(withJSONObject: dic!, options: JSONSerialization.WritingOptions.init(rawValue: 0))!, encoding: String.Encoding.utf8.rawValue)