Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITextView text property returns " " if " " is typed in by the user?

Does anyone have a solution to this? I did some google-ing and came up with zilch. I have no idea why a UITextView would replace   with a space, but it is indeed happening.

It is easy to duplicate - type the non breaking space code I placed in the title of this question into a UITextView, and then look at the text property, you'll see a space.

Is there a fix for this?

like image 695
bpatrick100 Avatar asked Mar 12 '11 04:03

bpatrick100


1 Answers

You are out of luck. This is most likely a bug, and it seems it has been filed with Apple.
See post UITextField converts non-breaking spaces to spaces?.

As a workaround you can use the delegate method textViewDidChange: to catch the keyboard input to keep track of any   occurrences and then react accordingly.

Cheers,
Sascha

like image 160
Mundi Avatar answered Oct 20 '22 01:10

Mundi