1

i m new to stackoverflow and this is my first question. My question is : I have a UINavigationController and have a UITableView inside it. I pass parameter to another view when a cell is clicked in tableview with didSelectRowAtIndexPath method, and i show the cell information in a label in another view which I called SecondViewController. Inside SecondViewController i have another label and i want to pass it's value to the selected cell's subvalue. As a conclusion i want to pass a value back to navigationcontroller's mainview.

Thanks for all your incoming responses. Regards, ae

aeciftci
  • 679
  • 2
  • 6
  • 15

2 Answers2

1

would suggest you to use the delegate concept to sorted out you probelm...

Check the useful SO link .

How do I create delegates in Objective-C?

How does a delegate work in objective-C?

Delegation pattern

Community
  • 1
  • 1
Jhaliya - Praveen Sharma
  • 31,697
  • 9
  • 72
  • 76
0

In your secondviewcontroller, the method which was called for popping to the main controller,inside that method pass the value to the mainview property.
For e.g.

One view :---mainview
Second View : secondcontroler

Now Inside secondcontroller:-- -(void)getbacktomainview
{
mainview *mn ; mn.someproperty = yourvalue;
[navigationController popViewControllerAnimated:YES];
}

Hope it helps you.....

Aman Aggarwal
  • 3,754
  • 1
  • 19
  • 26