I have this code in prepareForSegue method
UIViewController *viewController = [segue destinationViewController];
if ([viewController respondsToSelector:@selector(setSomethingOrOther:)]) {
[viewController setSomethingOrOther:something];
}
The code above means that I don’t need to include a link to the actual controller class of the view to which it is attached. I can more freely bind the two view controllers and just check if it responds to any property set on it.
The problem is that when I do this, I get the following compile time error:
No visible @interface for 'UIViewController' declares selector 'setSomethingOrOther:'
which is true of course. I know I can get around this by including a link to the view, but I would prefer to leave it separated. How can i get around this