I have a subclass of UIViewController called SurveyQuestion. I use an array of these for my app. I get the currently visible controller with this line:
SurveyQuestion *currentQuestionController = [self.navigationController visibleViewController];
Everything works, but Xcode gives me a warning of
Incompatible pointer types initializing 'SurveyQuestion *__strong' with an expression of type 'UIViewController *'
I know this is because visibleViewController returns a UIViewController, but it works because SurveyQuestion IS a UIViewController. Is there any way to suppress this error? Or should I be doing it a different way?
You can use cast like