Xcode在UILabel中写入NSLog结果 [英] Xcode write NSLog result in UILabel
本文介绍了Xcode在UILabel中写入NSLog结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用NSLog(@"%@");
并且NSLog结果为'23204239423' 我没有向您解释为什么……这只是一个例子.
And the NSLog result is '23204239423' I don't explain you why ... it's just an example.
我希望NSLog结果出现在UILabel中,这可能吗?
I want the NSLog result appear in UILabel, is it possible ?
我尝试过:Label.text = (@"%@");
,它不起作用.
I tried : Label.text = (@"%@");
, it doesn't work.
你知道我该怎么做吗?
Do you know how i can do it ?
谢谢.
推荐答案
NSLog通常采用类似以下的字符串:
NSLog usually takes a string like:
NSLog(@"%@", string);
因此,只需执行以下操作即可:
So instead just do this:
label.text = [NSString stringWithFormat:@"%@", string];
这篇关于Xcode在UILabel中写入NSLog结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文