user1494994
user1494994

Reputation:

iOS return result from ViewController to MainViewController

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.

Upvotes: 0

Views: 928

Answers (2)

Adnan Aftab
Adnan Aftab

Reputation: 14477

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.

Upvotes: 1

sha
sha

Reputation: 17860

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

Upvotes: 0

Related Questions