0

This link is my storyboard, i want to sent data from VC 1 to VC 3. I can travel from VC 1 to VC 3 with segue perfectly,but I cant sent data from VC 1 to VC 3, as i cant create an instance that is holding the destination VC.

Help is very much appreciated

EDIT: From VC1 am firing

 [self performSegueWithIdentifier:@"firstSegueFromleft" sender:self]; 

This is the segue that is the first segue from the left (topone) But I cannot sent data to VC3 by this method, but it is traveling to it.

I am getting an error "Unrecognized selector" when i try to access a property declared in VC3 in prepareForSegue of VC1.

Saheb Roy
  • 5,899
  • 3
  • 23
  • 35
  • Can you show me the code? how you are moving from VC 1 to VC 3? – Praksha Sep 22 '14 at 12:07
  • You can create a singleton model class, set properties while you are on VC1 and you can fetch same property on VC3 alternatively if you want to pass few data like userId etc you can save it AppDelegate. – Bharat Sep 22 '14 at 12:09
  • I cannot create a singleton class as this is how i will be sharing or sending values and it will be needed later on in my design. i am not able to connect an instance that i am creating of the Destination VC ie VC3, I can create an instance by importing its .h but it is not able to recognize the instance as destinationVC – Saheb Roy Sep 22 '14 at 12:15

2 Answers2

0

Solved :

I was able to do it by NSUserDefault. Looked at the apple documentation at how it is to be implemented and voila.

Saheb Roy
  • 5,899
  • 3
  • 23
  • 35
-2

import VC 3 .h file in VC 1 then do the following:

VC 3 *vc3 = [self.storyboard instantiateViewControllerWithIdentifier:@"VC 3 Identifier name as you mentioned in V C 3"];

vc3.property you have created in vc3 = "Data you want to send" 
Praksha
  • 265
  • 1
  • 3
  • 10