Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 30, 2008, 04:41 PM   #1
caldwelljason
macrumors member
 
Join Date: Jul 2008
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.
caldwelljason is offline   0 Reply With Quote
Old Jul 31, 2008, 09:53 AM   #2
caldwelljason
Thread Starter
macrumors member
 
Join Date: Jul 2008
Another way?

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...
caldwelljason is offline   0 Reply With Quote
Old Jul 31, 2008, 10:06 AM   #3
caldwelljason
Thread Starter
macrumors member
 
Join Date: Jul 2008
Nevermind

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...
caldwelljason is offline   0 Reply With Quote
Old Oct 9, 2008, 02:44 PM   #4
sixbit
macrumors newbie
 
Join Date: Jul 2008
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.
sixbit is offline   0 Reply With Quote
Old Dec 10, 2009, 03:32 AM   #5
ssakthivel
macrumors newbie
 
Join Date: Jun 2009
UITextView in UITableView

Hi,

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.
ssakthivel is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
UITextView drawing MrFusion iPhone/iPad Programming 1 May 9, 2014 09:58 PM
Setting UIImageView Behind UITextView RagingGoat iPhone/iPad Programming 4 May 19, 2013 07:11 PM
Resolved: speech to text in UITextView straber iPhone/iPad Programming 4 Mar 11, 2013 12:18 PM
UITextView in UITableView becomeFirstResponder returns NO after assignement statement terryah iPhone/iPad Programming 4 Feb 21, 2013 03:37 PM
UITextView insert rubenmit iPhone/iPad Programming 8 Aug 8, 2012 03:38 PM

Forum Jump

All times are GMT -5. The time now is 01:24 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC