xcode 预期类型错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10427410/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Expected a type error
提问by Nikolai Ruhe
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? SecViewControlleris not a type?
并且Xcode
一直Expected a type
在SecViewController *给我错误。这意味着什么?SecViewController不是一个类型?
回答by Nikolai Ruhe
You have to declare SecViewController
:
你必须声明SecViewController
:
@class SecViewController;
... at the top of your header.
...在标题的顶部。
Note: Don't just #import
all used headers. This just worsens your header dependencies.
注意:不要只是#import
所有使用的标题。这只会恶化您的标头依赖性。