PDA

View Full Version : pointers when creating custom uitableviewcell




webznz
Jun 6, 2011, 06:04 PM
I am trying to load a new view from a tableview:didSelectRowAtIndexPath: method that happens when the uitableviewcell is selected, I intend to send the user to a uitableview that displays a list of words that they can then use to populate the uitextfield thats in the custom uitableviewcell in the previous view.

however having the uitextfield there stops me from being able to select the uitableviewcell.. Is there a way to stop this from happening as I am displaying a placeholder in the uitextfield to inform the user as to what value will be held in that particular index.



RonC
Jun 6, 2011, 08:51 PM
I guess I'm lost in what it is you're trying to do. Here's what I get from what you wrote.

a) You have a tableview, with tableviewcells that are selectable (more than one?). An individual tableviewcell is a custom cell that contains a (editable?) text field.

b) You want to display another tableview with tableviewcells that are selectable. Those tableview cells have words in them.

If that's right, then I think it's as simple as toggling the userInteractionEnabled property of the UITextField in the custom table view cell. YMMV. Another thought is to add an accessory to your custom cell view to pop up your list of words.

Why is the text field in a table cell? (I'm curious)

webznz
Jun 6, 2011, 09:06 PM
I greating a list of search types what I have done apart from the one field where the user has to type in the search string, the rest i have changed to lables which allows the user to select anywhere on the uitableviewcell to click through to new view.

PhoneyDeveloper
Jun 6, 2011, 09:17 PM
You might want to look at Settings.app and find a case similar to yours. Maybe you need a button as the accessoryView, which pushes a new view controller when tapped.