Expected a type error

倾然丶 夕夏残阳落幕 提交于 2019-12-10 12:38:51

问题


So I created this method:

- (void)addToViewController:(SecViewController *)controller 
      didFinishEnteringItem:(NSString *)item;` <br>

And Xcode keeps giving me Expected a type error at SecViewController *. What does that mean? SecViewController is not a type?


回答1:


You have to declare SecViewController:

@class SecViewController;

... at the top of your header.

Note: Don't just #import all used headers. This just worsens your header dependencies.



来源:https://stackoverflow.com/questions/10427410/expected-a-type-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!