0

I have an app that has similar layout where a new ViewController will pop up when the button was clicked.

When the user clicks on one of the table cell, I would like to return this result to the main controller's function, please help.

2 Answers2

1

There are different ways to do this. - By using delegates. - By implementing Notifications. - Pass main view controller reference to the view controller and set some property or call method. Now its up to you what way you will use. But according to my point of view implementing delegates will be the best way for this. Following are some links from where you can understand how to pass data: - http://www.raywenderlich.com/forums/viewtopic.php?f=10&t=3265 - http://www.tutorialspoint.com/ios/ios_delegates.htm 2nd link will take you to the delegates tutorial.

Adnan Aftab
  • 14,377
  • 4
  • 45
  • 54
  • thanks for the advice! Can you please include some examples too please? –  Oct 05 '13 at 21:08
0

You might want to read about 'delegates'. Here is link to good SO discussion: What is a "delegate" in Objective C's iPhone development?

Community
  • 1
  • 1
sha
  • 17,824
  • 5
  • 63
  • 98