I have three ViewController A, B, and C.
I want to pass a data from A to C. But when user uses my app, he has to pass by B ViewController before C ViewController. And the segue identifier is between A and B.
ViewController A and C aren't linked in Storyboard. May be it's the problem...
I try this but Xcode doesn't recognize variable ndj2 from ViewController C.
I put the correct #import ViewControllerC.h
I already try to pass date between A and B, and it's working. It's to avoid to do two prepareForSegue (one between ViewController A and ViewController B / and another between ViewController B and ViewController C)
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
ViewControllerA *transferViewController = segue.destinationViewController;
NSLog(@"prepareForSegue: %@", segue.identifier);
if([segue.identifier isEqualToString:@"quelnom"]) // identifier between A and B
{
transferViewController.ndj2 = ndj;
// ndj2 is variable present in ViewController C
}
};
The real problem is ndj2 is non recognize , and i declared it properly. It's the Viewcontroller the problem but i don't understand why...