Re: add crlf to UITextView
Re: add crlf to UITextView
- Subject: Re: add crlf to UITextView
- From: Greg Guerin <email@hidden>
- Date: Wed, 25 May 2011 13:18:43 -0700
koko wrote:
I had changed the string I was appending to @"\n\nText to Add"
which also did not work.
You need to identify whether your string is a literal string in your
Objective-C source, or whether it's something loaded from somewhere
else.
If it's loaded from somewhere else, you need to identify whether it
contains the literal characters backslash-Small-Letter-R-backslash-
Small-Letter-N, or whether it contains the actual character codes for
CR and LF.
You can do all these things by writing some code that dumps out the
hex representations of every unichar in the string you are about to
append. Put this code immediately before the point where you call
stringByAppendingString:. Post what the hex output is.
If your string is a literal @"\n\nText" in an Objective-C source
file, then that should be getting converted to LF-LF-Text, because
the compiler will convert backslash-escaped characters. Refer to the
C rules on backslash used as an escape character in strings. If
you're not compiling the string with some kind of C compiler, then
backslash has no special meaning, and what you will get is a literal
backslash.
-- GG
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden