0
我有问题,无法在UITextView
中设置新文本。我已经在界面生成器中将IBOutlet
连接到textView
。这里是我的代码无法更改textview中的文本
- (void)viewDidLoad
{
[super viewDidLoad];
self.title = @"Detail";
[self setupTextView];
}
- (void) setupTextView
{
self.textDescription = [[[UITextView alloc] init] autorelease];
NSString *foo = @"blah blah blah";
textDescription.text = foo; //I try this and it didn't work
//here didn't work too.
//textDescription.text = [textDescription.text stringByAppendingString:foo];
/*Here is something for dynamic textview*/
CGRect frame;
frame = textDescription.frame;
frame.size.height = [textDescription contentSize].height;
textDescription.frame = frame;
/**/
}
感谢您阿努帮助:)
谢谢。它的工作我会在2分钟内接受你的答案。 (弹出窗口说我可以在2分钟内接受答案) – crazyoxygen 2011-04-21 04:52:14
ok gr8 :)。如果有用,请对答案进行投票 – visakh7 2011-04-21 04:54:50