Search code examples
iphonexcodelabeluilabelnslog

Xcode write NSLog result in UILabel


I use NSLog(@"%@");

And the NSLog result is '23204239423' I don't explain you why ... it's just an example.

I want the NSLog result appear in UILabel, is it possible ?

I tried : Label.text = (@"%@"); , it doesn't work.

Do you know how i can do it ?

Thanks.


Solution

  • NSLog usually takes a string like:

    NSLog(@"%@", string);
    

    So instead just do this:

    label.text = [NSString stringWithFormat:@"%@", string];