Answer the question
In order to leave comments, you need to log in
Working with segue.destrinationViewController in Xcode?
Good day!
Stuck in a problem, I've been digging for the second day.
There are two view controllers (let's call them VC1 and VC2). They are interconnected by a transition (segue) in Xcode (ctrl-drag from VC1 to VC2, the choice of method is push). I want to prepare VC2 for display:
VC1.m:
(...)<br/>
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender<br/>
{<br/>
if ([segue.identifier isEqualToString:@"mySegue"]) <br/>
{<br/>
VC2 *vc = segue.destinationViewController;<br/>
[vc blahblah:self];<br/>
}<br/>
}<br/>
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender<br/>
{<br/>
if ([segue.identifier isEqualToString:@"mySegue"]) <br/>
{<br/>
NSLog(@"source VC - %@", segue.sourceViewController);<br/>
NSLog(@"target VC - %@", segue.destinationViewController); <br/>
}<br/>
}<br/>
source VC - <VC1: 0x6861ed0><br/>
target VC - <UIViewController: 0x6878670><br/>
Answer the question
In order to leave comments, you need to log in
Ok, I'll guess ...
I'm almost sure that the reason is in the wrong data of the Interface
Builder
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question