【发布时间】:2011-04-21 04:38:32
【问题描述】:
我遇到了无法在UITextView 中设置新文本的问题。我已经在界面生成器中将IBOutlet 链接到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;
/**/
}
感谢您的帮助:)
【问题讨论】:
标签: iphone objective-c ios ios4 uitextview