0

I have two view controllers inside a Navigation Controller.

First view controller calls, with a push segue, second view controller. In second view controller I have a UIDatePicker and a "Ok" button. I need that when i press Ok button:

  • I go back to my first view controller.
  • I pass the NSDate to it.

How can I do it on iOS<6.0? Unwind segues are not available.

Ales
  • 19
  • 8
  • Why you even want to code for iOS 6 and below? See: https://developer.apple.com/support/appstore/ Now iOS 7 is already over 88% and iOS 6 is 10%. iOS 5 and below is only 2%. Right now, I don't event consider iOS 6 for the development. If it is the requirement of your customers, I would like to suggest you to convince them not to optimize for iOS 6 and below. – Ricky May 15 '14 at 08:41
  • I have only a iOS 5.1 device to test my app. Also, I think it's impossible that before iOS6 my problem could not be solved... – Ales May 15 '14 at 09:08
  • I see. I think testing on simulator on Xcode is good enough for most of the cases. It can be solved but I believe most iOS developer do not care much about iOS 5 and below anymore. – Ricky May 15 '14 at 09:09
  • 1
    You should use delegation. When you click the OK button, call your delegate method to pass the NSDate back. Then you can call popViewControllerAnimated to go back to your first view controller. Link to relevant post - [Passing Data between View Controllers](http://stackoverflow.com/questions/5210535/passing-data-between-view-controllers?rq=1) – asjj May 15 '14 at 10:28

0 Answers0