如何获取 UItextView 的字符串值? [英] How to get the string value of a UItextView?
本文介绍了如何获取 UItextView 的字符串值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个 UITextView 和一个 NString;
I have a UITextView and a NString;
我做了这个:
myS = [myInfoTextView text];
但我在控制台中得到了这个,而不是在 uitextview 中的字符串
but i get this in the console and not the string which is in the uitextview
(
"<UIToolbarTextButton: 0x4d200c0; frame = (6 0; 112 44); opaque = NO; layer = <CALayer: 0x4da5540>>",
"<UIToolbarTextButton: 0x4da5bb0; frame = (128 0; 106 44); opaque = NO; layer = <CALayer: 0x4d9e640>>"
)
PS:我使用的是 iphone sdk 4.2.
PS: I'm using the iphone sdk 4.2.
推荐答案
代替上面的代码,试试这个
Instead of the above code, try this
NSString *textValue = [NString stringWithFormat:@"%@", myTextView.text];
NSLog(@"%@", textValue);
这篇关于如何获取 UItextView 的字符串值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文