gpt4 book ai didi

ios - 删除时间戳和进程ID

转载 作者:行者123 更新时间:2023-12-01 20:05:25 24 4
gpt4 key购买 nike

我在调试中使用代码显示用户号码。如何仅在调试行2016-08-20 13:02:52.773 1[37441:2806628]中删除

for (int i=0; i<100; i++) 
{
NSLog(@"user %d", i);
}

在调试中我想得到
user1 
user2
user3

等等

但是得到这个
2016-08-20 13:02:52.773 1[37441:2806628] user1
2016-08-20 13:02:52.773 1[37441:2806628] user2
2016-08-20 13:02:52.773 1[37441:2806628] user3

我如何删除这些行
2016-08-20 13:02:52.773 1[37441:2806628] 
2016-08-20 13:02:52.773 1[37441:2806628]
2016-08-20 13:02:52.773 1[37441:2806628]

最佳答案

使用printf而不是NSLog:

for (int i=0; i<100; i++) 
{
printf("User=%d\n",i); //Here \n is for new line
}

Difference between NSLog and Printf statement for ObjectiveC

关于ios - 删除时间戳和进程ID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39052935/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com