0

My UINavigationController contains 3 UIViewControllers in order A -> B -> C; C is the TopViewController.

Before I pop C, I need to pass some data (that has been gathered in C) to B. How can this be done??

Shradha
  • 991
  • 3
  • 13
  • 38
  • Give 'C' a pointer to 'B'. Often this is done using the [Delegate Pattern](https://developer.apple.com/library/ios/documentation/General/Conceptual/DevPedia-CocoaCore/Delegation.html). – i_am_jorf Oct 10 '14 at 17:14

1 Answers1

0

There are multiple ways you could do this. One is to use delegate pattern. A good article on this can be found here. Also you may use NSNotifications to this. You can find more info on this here.

Dilshan
  • 3,231
  • 4
  • 39
  • 50
  • In my opinion, notifications is not the correct method in this instance, however delegation for sure, or using blocks. – Nick Oct 10 '14 at 17:26
  • Yes its not recommended and its not correct. I agree. Thats why I used the word "may". – Dilshan Oct 10 '14 at 17:27