预计会出现类型错误 [英] Expected a type error

查看:82
本文介绍了预计会出现类型错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我创建了这个方法:

So I created this method:

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

Xcode 一直给我 SecViewController * 预计出现类型错误。那是什么意思? SecViewController 不是类型?

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

推荐答案

你必须声明 SecViewController

@class SecViewController;

...位于标题顶部。

... at the top of your header.

注意:不要只是 #import 所有使用过的标题。这只会恶化您的标头依赖性。

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

这篇关于预计会出现类型错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆