How to insert new line \n from UILabel text which typed in IB?

Alex picture Alex · Mar 16, 2013 · Viewed 26.1k times · Source

I have id textInput and I insert new line(\n) OK with:

[textInput insertText:@"\n"];

But when input Text from label.text (Input in Interface Builder) ,it NOT OK. Just input \n text.

NSLog(@"%@",label.text);
[textInput insertText:label.text];

How to input special character when store it in label.text?

I don't want to compare [inputStr isEqualToString:@"\\n"];

*Log: \n

Thanks!

Answer

tc. picture tc. · Mar 16, 2013

Try option-return or pasting in the newline.