views:

22

answers:

1

How do I get a UITextView to use /n characters in strings as new lines?

For example, I want the string "Hello world!/nHow are you?" to appear in the UITextView as:

Hello World!

How are you?

But it instead appears as:

Hello World!/nHow are you?

...when I write myTextView.text = @"Hello world!/nHow are you?"

+1  A: 

You should be using \n, not /n.

myTextView.text = @"Hello World!\nHow are you?";

should work.

rickerbh
Ah, thanks Rickerbh. Naturally, since it was such a simple solution, I completely overlooked it. That certainly explains why I couldn't find any questions from other people who have had this problem before!
Joe