Невозможно изменить текст в текстовом представлении - PullRequest
0 голосов
/ 21 апреля 2011

У меня проблема с, я не могу установить новый текст в 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;
     /**/
}

Спасибо за помощь anu:)

1 Ответ

1 голос
/ 21 апреля 2011
self.textDescription = [[[UITextView alloc] init] autorelease];

Я думаю, что это проблема.Если textDescription является IBOutlet, вам не нужно его выделять.Просто удалите это распределение.

...