|Jul 30, 2008, 05:41 PM||#1|
UITextView on a UITableView
So I have a UITableView with several UITextFields in cells on the page. I want one of the fields to support multiple lines of text, so I am trying to replace it with a UITextView. All controls are members of the class and are initialized in cellForRowAtIndexPath if they don't already exist. The controls are released in -(void)dealloc.
Problem is, when I replace the UITextField with a UITextView, everything sort of goes crazy. The view loads properly and I can edit the text in the field. But when I leave the view, the debugger console (which has been attached to the process up to this point) prints the banner again, starting with "Loading program into debugger..." (as if it had just attached), the UI freezes, and I have an __objc_error at the top of the call stack. The highest recognizable method name on the stack is -[UITextView webViewDidChange:].
I don't know what to make of this or how to get my UITextView working in this context. I have searched the forums and the samples to no avail.
Thank you for any help you may provide.
|Jul 31, 2008, 10:53 AM||#2|
Let me change the question and see if that generates any more ideas.
I read somewhere last night that it was a bad idea to put a UITextView on a UITableView because they are both UIScrollView-based and that is apparently bad.
The UITableView I have is static, meaning I have a fix number of defined fields and it doesn't have to scroll. I am really using the UITableView for convenience. It draws the cells in groups with round corners and handles the UITableViewCellAccessoryDisclosureIndicator drawing for me.
So new question: Is there an easy way to get the same look that I am getting from the UITableView (groups of rows with rounded corners and drill-down indicators) without actually using a UITableView? Clearly, I don't want to draw that all myself...
|Jul 31, 2008, 11:06 AM||#3|
Problem solved. Still not sure why, though.
Apparently, I am getting the error if I set the delegate for the UITextView to the UITableViewController that is hosting it. If I remove that delegate assignment (I can live without it), then it works just fine.
It must have something to do with a message being sent after I have released the textView object. But I haven't been able to get an exception in the console or anything to specifically identify that...
|Oct 9, 2008, 03:44 PM||#4|
I had the same problem with TextView with the same odd stack trace (webViewDidChange) in a different view hierarchy , indeed the controller was receiving the message after it'd been dealoc'd. But in my case I needed the delegate to be the controller that was hosting the view, so i was able to solve the problem by setting the delegate to nil on the textview before i released it in the dealloc of the controller. problem solved.
|Dec 10, 2009, 04:32 AM||#5|
UITextView in UITableView
I am also facing the same problem.I thought u found out the solution.My problem is that i have 20 sections each with one row. In each cell i am using one uitextview which will display variable size content.So,when i scroll the tableview it is very slow as well as some text is missing for a while.
Can u please help me out with this issue.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|UITextView drawing||MrFusion||iPhone/iPad Programming||1||May 9, 2014 10:58 PM|
|Setting UIImageView Behind UITextView||RagingGoat||iPhone/iPad Programming||4||May 19, 2013 08:11 PM|
|Resolved: speech to text in UITextView||straber||iPhone/iPad Programming||4||Mar 11, 2013 01:18 PM|
|UITextView in UITableView becomeFirstResponder returns NO after assignement statement||terryah||iPhone/iPad Programming||4||Feb 21, 2013 04:37 PM|
|UITextView insert||rubenmit||iPhone/iPad Programming||8||Aug 8, 2012 04:38 PM|
All times are GMT -5. The time now is 10:53 AM.