How do i set the delegate for a modal transition?
Currently I have something like:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
[segue.destinationViewController setDelegate:self];
}
- (void)nextViewController:(NextViewController *)sender setSomething(NSString *)something
{
NSLog(@"Something happened in nextviewcontroller");
}
This works if the transition is a push, but when it is a modal (arrow goes to a navigation controller) nothing happens.
Why is this and what is a work around?
In prepareForSegue I needed to set the delegate to the topView of the navigation controller.
like this: