문제

I have this code, and every time that I'm using it, the viewDidLoad of the destination view is called twice.

why it's happening?

Destination *myDestination = [self.storyboard instantiateViewControllerWithIdentifier:@"destination "];
MyCustomSegue *segue = [[MyCustomSegue alloc] initWithIdentifier:@"CustomSegue" source:self  destination : myDestination];
[segue perform];
도움이 되었습니까?

해결책

I think you can achieve this by calling method presentViewController: animated: completion:; e.g

Destination *myDestination = [self.storyboard instantiateViewControllerWithIdentifier:@"destination "];
[self presentViewController:myDestination animated:YES completion:nil];

I hope this will help you out.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top