简体   繁体   English

在Xcode 4中导入Objective-C JSON框架

[英]Importing Objective-C JSON Framework in Xcode 4

The instructions for installing the JSON Framework seem to be for older versions of Xcode. 安装JSON Framework的说明似乎适用于旧版本的Xcode。 I'm relatively unfamiliar with Xcode and I can't figure out how to properly import the framework into my project. 我对Xcode比较熟悉,我无法弄清楚如何将框架正确导入到我的项目中。 I selected all of the files in the "Classes" folder (JSON.h, NSObject+JSON.h, etc.) that comes in the download, dragged them into the main area of my project, and added #import <JSON/JSON.h> to my ViewController's .h and .m files, and I get a No such file or directory error for JSON/JSON.h 我选择了下载中的“Classes”文件夹(JSON.h,NSObject + JSON.h等)中的所有文件,将它们拖到我项目的主要区域,并添加了#import <JSON/JSON.h>到我的ViewController的.h和.m文件,我得到一个没有这样的文件或目录错误的JSON / JSON.h

What am I doing incorrectly here? 我在这里做错了什么?

If you've placed the files under the Classes group and haven't taken any further action, they're at the root of your project directory. 如果您已将文件放在Classes组下并且未采取任何进一步操作,则它们位于项目目录的根目录下。 As such, import it as 因此,将其导入为

#import "JSON.h"

我想你是在说明你是从JSON文件夹导入JSON.h,从你的描述中听起来你没有文件夹中的那些......

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM