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

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!


Solution 1:

Try option-return or pasting in the newline.

Solution 2:

@Hot Licks explained the reason well in comment.

The only way is

if ([self.mylabel.text isEqualToString:@"\\n"]) {

   [self.myTextView insertText:@"\n"];
}

Manually, use ALT+ENTER