I have created a custom subclass of UITableViewCell. There, I allow the user to edit some text in a UITextView. The cell belongs to a table in a popup view which is a subview of the root view. Now, I need to pass the text edited in the table cell, along with other data in the cell, to the root view. This is because, this edited data has to be sent to a webview which is also a subview of the root view.
I considered the following approaches. One is to make the popup view a delegate of the custom cell view and the root view a delgate of the popup view and pass the data through delegate method calls. This could make the design too complex. The second way is to store a reference to the webview in a singleton class when it is created and update it directly from the cell. But that would make the encapsulation all these classes are trying to achieve totally pointless.
What is the best approach to take? Is there any way other than the two I have suggested?
Use
NSNotificationCenter, see the Class ReferenceCreate the Notification
Post a Notification
Handle the Notification