Xcode不立即识别新类(iOS) [英] Xcode Not Immediately Recognizing New Classes (iOS)

查看:103
本文介绍了Xcode不立即识别新类(iOS)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用Xcode约5个月了,我刚刚遇到了一个问题,当我添加一个新类。如果我添加一个新类,例如CustomCell,我尝试导入'#import CustomCell.h'到一个不同的.m文件,它会给我一个错误,说'CustomCell.h文件未找到',即使它是正确的有在名单上。我在过去没有问题,我知道我在做什么,当进口(至少我没有改变我以前的方式,当它工作的方式)。

I've been working with Xcode for about 5 months now and I just recently ran across a problem when I add a new class. If I add a new class, say for example "CustomCell" and I try to import '#import CustomCell.h' into a different .m file it will give me an error saying 'CustomCell.h file not found' even though it's right there on the list. I've had no problem with this in the past and I know what I'm doing when it comes to importing (at least I haven't changed the way I previously went about it when it worked).

我最近有过这个问题,有时如果我关闭XCode并重新启动它会识别类。有其他人有这个问题吗?是否有快速方法只是刷新项目,看看Xcode是否能识别新类?

I've had this problem more than once recently and sometimes if I just close out XCode and restart it it will recognize the class. Has anyone else had this problem? Is there a quick way to just refresh the project to see if Xcode can recognize the new class?

推荐答案

关闭所有项目,打开组织者(从窗口菜单),确保选择正确的项目,然后点击删除对应的派生数据。

Close all your projects, open the organizer (from the window menu), make sure the correct project is selected, then opposite 'derived data' click delete.

然后关闭xcode,打开它,打开你的项目,清理它,一切都应该工作正常。

After that, close xcode, re-open it, open your project, clean it, and everything should work okay.

这篇关于Xcode不立即识别新类(iOS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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