NSLog没有换行 [英] NSLog without new line
本文介绍了NSLog没有换行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有任何功能可以完成NSLog的工作,但最后没有换行?
Is there any function that does what NSLog does but without the new line at the end?
推荐答案
请参阅此 http://borkware.com/quickies/one?topic=NSString
该页面的摘录:
void LogIt (NSString *format, ...)
{
va_list args;
va_start (args, format);
NSString *string;
string = [[NSString alloc] initWithFormat: format arguments: args];
va_end (args);
printf ("%s\n", [string UTF8String]);
[string release];
} // LogIt
只需定制printf即可满足您的需求
just customize the printf to suit your needs
这篇关于NSLog没有换行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文