0

How do I save the information after pressing the button Back on NavigationController? Then use the data in the current ViewController.

Wain
  • 118,658
  • 15
  • 128
  • 151
  • What have you thought about / researched / tried? – Wain Nov 08 '13 at 19:54
  • I create @property(nonatomic) NSString str;(and synthesize) in 1st ViewController and in 2nd ViewController #import "FirstViewController",and in 2ndViewController str = textfield.txt; – user2950387 Nov 08 '13 at 19:58
  • http://stackoverflow.com/questions/5210535/passing-data-between-view-controllers – Wain Nov 08 '13 at 20:07

1 Answers1

0

in the current controller viewDidLoad

self.navigationController.delegate = self;

then implement

– navigationController:willShowViewController:animated:
– navigationController:didShowViewController:animated:

source: https://developer.apple.com/library/ios/documentation/UIKit/Reference/UINavigationControllerDelegate_Protocol/Reference/Reference.html

matti157
  • 1,288
  • 2
  • 13
  • 26