0

i made an app that show some text in UIWebview, but the text is edited or input in UITextview. My problem is, i want to show "&lt;" and another HTML special characters in UIWebview, but when i type it in UITextview, it got something wrong. When i NSlog on textViewDidChange delegate method, the string is showed is "<"

2011-03-10 16:43:19.228 MyApp[4943:207] text DID CHANGE : <

so, the text in UIWebview always show "<". I think i have to change in some logical in textViewDidChange delegate method, but i dont know what.

Do somebody face a same case like mine?? Please share something to me.

Thank You

Regards,

Risma

UPDATE

sorry, i was wrong about changing logical textViewDidChange delegate method, becuase, we can change it or override this method with some code that we need. Now i realize, that UITextview always translate "&lt;" into "<", maybe this is because UITextView have an inheritance behavior from webkit. And then i think, i have to find some way to encode "&lt" in that UITextview, but i'm still search the best way to do that. Is there anybody can help me??

UPDATE

i think there is some layer in UITextview, maybe if i can get the top layer in UITextview, i can get the "&lt;" text before it decode to be "<". But i dont know how to get it. I was try to debug UITextview, but it still didn't show the layer to me, do somebody know how to get this top layer?? And is my opinion correct??

R. Dewi
  • 4,141
  • 9
  • 41
  • 66

1 Answers1

0

I'm don't know if there is a way to escape it, but you maybe can tray with &amp;lt;

pconcepcion
  • 5,591
  • 5
  • 35
  • 53
  • i was try that in textViewShouldChangeTextInRange delegate method using stringByReplacingOccurenceString, but before the text is replaced, it sended to textViewDidChange delgate method, and it replaced into "<" – R. Dewi Mar 16 '11 at 03:29