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