Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unwind Segues are not passed to the child view controller #5

Closed
RVijay007 opened this issue May 18, 2013 · 2 comments
Closed

Unwind Segues are not passed to the child view controller #5

RVijay007 opened this issue May 18, 2013 · 2 comments

Comments

@RVijay007
Copy link

I'm having an issue where my unwind segues are not passed to the child view controller of the Storyboard Link. The canPerformUnwindSegue method correctly detects whether the child view controller implements the desired unwind method, but the method is called on the StoryboardLink instead of the child view controller. I ended up adding forwarding invocation code to your class to get the messages passed to the correct controller.

- (BOOL)respondsToSelector:(SEL)aSelector {
    if ([super respondsToSelector:aSelector])
        return YES;
    else {
        return [self.scene respondsToSelector:aSelector];
    }
    return NO;
}

- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector {
    NSMethodSignature* signature = [super methodSignatureForSelector:aSelector];
    if (!signature) {
        signature = [self.scene methodSignatureForSelector:aSelector];
    }
    return signature;
}

- (void)forwardInvocation:(NSInvocation *)anInvocation {
    if ([self.scene respondsToSelector:[anInvocation selector]])
        [anInvocation invokeWithTarget:self.scene];
    else
        [super forwardInvocation:anInvocation];
}
rob-brown added a commit that referenced this issue Sep 15, 2013
Fixes issue #5.
@rob-brown
Copy link
Owner

Thanks for including the code snippet. I also updated the LinkedStoryboards sample accordingly.

@nonstriater
Copy link

@rob-brown that's really a bad idea, -forwardInvocation cause so many bugs.detail see #68 #71

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants