How to insert new line \n from UILabel text which typed in IB?
IosObjective CNsstringIos Problem Overview
I have id
[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!
Ios Solutions
Solution 1 - Ios
Try option-return or pasting in the newline.
Solution 2 - Ios
@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