如何在Objective C中编写日志文件?

Kyl*_*yle 1 console logging objective-c console-application

如果我在目标C中进行大规模操作,并且在控制台中发生了很多...我无法在Windows中看到这一切.

而不是添加参数">>WriteLog.log"在Objective C中记录控制台的正确方法是什么?

Jam*_*uld 7

NSLog 是在Objective-C中登录控制台的常用方法

您可以像以下一样使用它:

NSLog(@"My log string");
Run Code Online (Sandbox Code Playgroud)

要么

NSLog(@"%@", someStringObject);
Run Code Online (Sandbox Code Playgroud)