I have problem with can't set new text in UITextView
.I already link up the IBOutlet
to textView
in interface builder. Here is my code
- (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;
/**/
}
Thank you for anu help :)
self.textDescription = [[[UITextView alloc] init] autorelease];
I think this is the problem. If textDescription
is an IBOutlet
you don't need to allocate it. Just remove this allocation.