开发者

help with xcode warning

开发者 https://www.devze.com 2023-03-20 05:48 出处:网络
I get the following war开发者_如何学JAVAning in my appdelegate.m file: warning: incompatible Objective-C types \'struct QuestionnaireViewController *\', expected \'struct UIViewController *\' when pa

I get the following war开发者_如何学JAVAning in my appdelegate.m file:

warning: incompatible Objective-C types 'struct QuestionnaireViewController *', expected 'struct UIViewController *' when passing argument 1 of 'setRootViewController:' from distinct Objective-C type

QuestionnaireViewController subclasses UIViewController so I'm, not sure why it's causing problems...


It sounds like you probably forward-declared the class using @class QuestionnaireViewController and didn't actually import the header. If you did this, the compiler only knows that the class exists, but it doesn't know anything else about it, so it doesn't know that it is a subclass of UIViewController. Make sure you #import "QuestionnaireViewControllier.h" inside of your .m file.

0

精彩评论

暂无评论...
验证码 换一张
取 消