-3
  1. The app starts on ViewContoller
  2. I push TutoViewContoller
  3. On some action, I pop TutoViewContoller

I would like to call a method of ViewContoller just after popping TutoViewController. How can I do that ?

Cherif
  • 5,223
  • 8
  • 33
  • 54
  • Call that method in viewwillappear: method of viewcontroller – Indrajeet Nov 07 '14 at 12:29
  • I don't want it to be called everytime the view appears. I want want it to be called after popping TutoViewController. – Cherif Nov 07 '14 at 12:32
  • ok, then maintain one bool prefrence by default set it to 'No' and when it goes to TutoViewController set it to 'yes' and check that preference in viewwillappear of viewcontroller – Indrajeet Nov 07 '14 at 12:35
  • there are 2 options for that. first is use NSNotificationCenter and second is use delegate. for delegate see this : http://stackoverflow.com/questions/18566304/sending-data-from-one-viewcontroller-to-another – Max Nov 07 '14 at 12:46

1 Answers1

1

You can implement viewWillAppear of ViewController. If you really need to distinguish between TutoViewController and other viewcontroller you have many options to call before you pop it: delegate pattern, passing reference of ViewController to TutoViewController etc.

Viktor Kucera
  • 6,177
  • 4
  • 32
  • 43