为什么 XCode 无法识别这个头文件 [英] Why does XCode not recognize this header file

查看:37
本文介绍了为什么 XCode 无法识别这个头文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试学习 XCode,并且正在学习在线课程.他们告诉使用 #import 命令指向头文件.我按照这封信的说明进行操作,但收到一条错误消息,提示没有此类文件或目录",但该文件列在类下并且拼写相同.我想包括一个截图,但不能.请帮忙!

I am trying to learn XCode and I am following an online course. They are telling to use the #import command to point to a header file. I follow the instruction to the letter and I get an error saying"no such file or directory" but the file is listed under classes and the spelling is identical. I wanted to included a screenshot but could not. Please help!

推荐答案

您收到该错误是因为 Xcode 找不到您尝试导入的文件.

You are getting that error because Xcode cannot find the file you are trying to import.

正确用法:

#import "RootViewController.h"

#import <Foundation/Foundation.h>

您还必须确保您尝试导入的文件在您的项目列表中.如果您尝试导入的文件不在此列表中,那么您将始终收到此错误.

You also have to make sure that the file(s) you try to import are in your Project list. If the file you are trying to import is not in this list, then you will always receive this error.

这篇关于为什么 XCode 无法识别这个头文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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