s_curry_s
s_curry_s

Reputation: 3432

Unwind Segue Issue

I was following this tutorial to understand unwind segues

http://pragmaticstudio.com/blog/2013/2/5/unwind-segues

Everything works fine until the end:

- (IBAction)completeSignIn:(UIStoryboardSegue *)segue {
   DSTSignInViewController *signInVC = segue.sourceViewController;
   self.greetingLabel.text = signInVC.signInName;
}

I get the error "Unknown type name "DSTSignInViewController"

Upvotes: 1

Views: 222

Answers (1)

Chris Wagner
Chris Wagner

Reputation: 21013

Based on the discussion in the comments... It sounds like you want something like the following.

@protocol DSTSSignInController

@property (nonatomic, strong) NSString signInName;

@end

And then

- (IBAction)completeSignIn:(UIStoryboardSegue *)segue {
   UIViewController<DSTSSignInController> *signInVC = segue.sourceViewController;
   self.greetingLabel.text = signInVC.signInName;
}

This way you can just import the header that defines the DSTSSignInController protocol and not DSTSignInViewController or any other possible implementations/conformers.

Upvotes: 1

Related Questions