I have a very strange problem with something that is probably easy to solve, but I can't get it to work. I want to add a UITextview to a UITableViewCell (but I also tried this in a simple view, this gives me the same problem). I do this in a storyboard or programmatically, the application crashes (sometimes only the second time the view is displayed!) With the message
- [UITextView length]: unrecognized selector sent to instance <...>
Here I add a UITextview (in CellForRowAtIndexPath: . @property UITextView *description , which I assigned to them, which was synthesized.
//description cell if([indexPath section] == 2 && [indexPath row] == 0) { UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(7.0f, 5.0f, 285.0f, 140.0f)]; textView.editable = YES; textView.delegate = self; textView.backgroundColor = [UIColor clearColor]; textView.font = [UIFont systemFontOfSize:14.0f]; [cell.contentView addSubview:textView]; self.description = textView; }
Please let me know if you need more code. Thanks in advance!
source share