How to programatically set cell.textLabel.text from a different view?

Posted by Andy on Stack Overflow See other posts from Stack Overflow or by Andy
Published on 2010-04-22T11:54:32Z Indexed on 2010/04/22 20:23 UTC
Read the original article Hit count: 267

I've got a view controller, call it VC1, that's a table view. When I tap a cell in the table view, I am presented with a new view controller, call it VC2, which is a short list of choices. After making a choice, I want to dismiss VC2 and set the cell.textLabel.text property of the VC1 cell I originally tapped to the value I selected in VC2.

Conceptually speaking, what is the proper way to do this? I've tried a handful of different approaches, but all of them seem wonky at best, and only one of them actually worked - although it was the most cumbersome of all, passing references to both view controllers and table view cells and all kinds of things. It just feels like I'm making a mountain out of what is probably a mole hill.

This is such a common paradigm that I find it hard to believe there's not a simple method for doing it. Thanks in advance for any input you can offer.

© Stack Overflow or respective owner

Related posts about iphone-sdk

Related posts about cocoa-touch