NSLog可以打印的最大大小 [英] Maximum size a NSLog can print
问题描述
我正在尝试打印一系列字典。该词典包含300个键及其值。数组中大约有6000多个字典。但是当字典中的字典数少于3300时,NSLog可以打印该数组。当我尝试在该数组中添加更多的字典数(> 3300)时,该数组未得到打印。我在xcode控制台中变得一片空白。
I was trying to print an array of dictionaries. The dictionary contains 300 keys and their values. There are about more than 6000 dictionaries in the array. But NSLog could print the array when the number of dictionaries in it were less than 3300. When i tried to add more number of dictionaries in the array(>3300),the array was not getting printed. I was getting blank in the xcode console. Is there a certain limit to which NSLog can print values?
推荐答案
NSLog可以打印1022个字符
NSLog prints 1022 chars
如果要扩展NSLog的打印限制,可以在全局头文件中将NSLog重新定义为printf
if you want to extend NSLog print limit,you may redefine NSLog to printf in global header file
#define NSLog(FORMAT, ...) printf("%s\n", [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
这篇关于NSLog可以打印的最大大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!