How to get the string value of a UItextView?
I have a UITextView and a NString;
I made this:
myS = [myInfoTextView text];
but i get this in the con开发者_如何学编程sole 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: I'm using the iphone sdk 4.2.
Instead of the above code, try this
NSString *textValue = [NString stringWithFormat:@"%@", myTextView.text];
NSLog(@"%@", textValue);
That is the specification of the ToolBar Button.You are not getting the value of Text view in string and moreover you are not priting it with NSLog.You get the text in the console by printing it with NSLog. Do it the way as Snehal is saying.
NSString *textValue = [NSString stringWithFormat:@"%@", myTextView.text];
NSLog(@"Text Value is %@", textValue);
Hope you will get to the desired output.
精彩评论