开发者

Save UITextView content in NSString

开发者 https://www.devze.com 2022-12-23 03:21 出处:网络
I\'m trying to save the contents of an UITextView into a NSString which I will somehow persist later.

I'm trying to save the contents of an UITextView into a NSString which I will somehow persist later.

The problem is that the U开发者_JS百科ITextView "text" property doesn't save all the rows in the textView (after touching "return"). I tried print the TextView object and the textView.text, and they're different.

Does anybody know how (after editing the textView) I can save its content into a String (or something else that I can later access and share through different views and persist in the database)?

Thanks a lot. Pretty sure it is simple, but I'm honestly not finding the solution.


NSString *textViewString = myTextView.text

ought to be what you need. But you say that the TextView object and its text property have different values? Has your delegate received – textViewDidEndEditing: or – textViewDidChange: yet?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号