JSON - 关于iPhone SDK错误的框架

时间:2023-01-22 17:33:17

I'm getting an error when I run any project with the JSON-Framework installed:

当我运行安装了JSON-Framework的任何项目时,我收到错误:

Xcode could not locate source file: NSString+SBJSON.m (line: 50)

Xcode无法找到源文件:NSString + SBJSON.m(第50行)

I assumed this means it can't find the sdk, the strange this is that the project builds and runs up until I make my first JSON call:

我认为这意味着它无法找到sdk,奇怪的是这个项目构建并运行直到我进行第一次JSON调用:

NSArray *data = [responseString JSONValue];

The JSON folder is in: ~/Library/SDKs

JSON文件夹位于:〜/ Library / SDKs中

I added the additional sdks argument: $HOME/Library/SDKs/JSON/$(PLATFORM_NAME).sdk

我添加了额外的sdks参数:$ HOME / Library / SDKs / JSON / $(PLATFORM_NAME).sdk

I also added the linker flags: -ObjC -ljson

我还添加了链接器标志:-ObjC -ljson

To make sure I wasn't crazy, I ran a tutorial here. This tutorial also gets the same error. (I also ran one from mobile orchard with similar results, except for the file: SBJSON.m)

为了确保我没有疯狂,我在这里运行了一个教程。本教程也会出现相同的错误。 (除了文件:SBJSON.m之外,我还从移动果园运行了一个具有类似结果的果园

I must have set something up wrong, any ideas?

我必须设置错误,任何想法?

2 个解决方案

#1


As stated in the above comments, I just added the source code directly. Not the ideal solution, but it worked.

如上面的评论中所述,我只是直接添加了源代码。不是理想的解决方案,但它有效。

I'm sure installation will get better...

我相信安装会变得更好......

#2


You might want to get info on your file and make sure the path type is set to "Relative to Project". This resolved my issue.

您可能希望获取有关文件的信息,并确保路径类型设置为“相对于项目”。这解决了我的问题。

#1


As stated in the above comments, I just added the source code directly. Not the ideal solution, but it worked.

如上面的评论中所述,我只是直接添加了源代码。不是理想的解决方案,但它有效。

I'm sure installation will get better...

我相信安装会变得更好......

#2


You might want to get info on your file and make sure the path type is set to "Relative to Project". This resolved my issue.

您可能希望获取有关文件的信息,并确保路径类型设置为“相对于项目”。这解决了我的问题。