ios Xcode 5 - 如何添加标题搜索路径并使用 GDataXMLNode

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20157365/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 22:29:13  来源:igfitidea点击:

Xcode 5 - How to add Header Search Path and use GDataXMLNode

iosxmlxcodegdataxml

提问by ngoue

I am trying to use GDataXMLNode to parse an XML file. I am following the tutorial on this blog:

我正在尝试使用 GDataXMLNode 来解析 XML 文件。我正在关注此博客上的教程:

http://www.raywenderlich.com/725/xml-tutorial-for-ios-how-to-read-and-write-xml-documents-with-gdataxml

http://www.raywenderlich.com/725/xml-tutorial-for-ios-how-to-read-and-write-xml-documents-with-gdataxml

My problem is trying to add the GDataXMLNode to my project and getting it to work. I'm supposed to do something with the configurations, add a Header Search Path, and a few other things, but every single example I've found online is for a previous version of Xcode. I'm currently using Xcode 5 and I have tried everything (PLEASE prove me wrong), but nothing is working the way it's supposed to in this tutorial.

我的问题是尝试将 GDataXMLNode 添加到我的项目中并使其工作。我应该对配置做一些事情,添加一个标题搜索路径,以及其他一些事情,但我在网上找到的每个例子都是针对以前版本的 Xcode。我目前正在使用 Xcode 5 并且我已经尝试了所有方法(请证明我错了),但是没有任何东西按照本教程中的预期方式工作。

So, any help as to how I might go about this and get it working together with my iOS project would be much appreciated. Let me know if I can expound on anything I've said.

因此,对于我如何解决这个问题并将其与我的 iOS 项目一起工作的任何帮助将不胜感激。让我知道我是否可以解释我所说的任何内容。

回答by Andrey

You should select "All" in Project Settings to show all the parameters, including "Header Search Paths" and "Other Linker Flags".

您应该在 Project Settings 中选择“All”以显示所有参数,包括“Header Search Paths”和“Other Linker Flags”。

The image to show "All"

显示“全部”的图像

回答by Phong Nguyen

It's quite easy, follow instruction but remember that GDataXMLNode does not support ARC. You can do the same instruction as Andrey. But I think it should be located in a sub-project, for example: Library.xcodeproj. If you want to organize your code formally.

这很容易,按照说明进行操作,但请记住 GDataXMLNode 不支持 ARC。您可以执行与 Andrey 相同的指令。但我认为它应该位于一个子项目中,例如:Library.xcodeproj. 如果你想正式组织你的代码。

Firstly, create Library.xcodeproject, add GDataXMLNode. In Build Settings, you also include "Header Search Path" and "Other Linker Flags". But don't forget that GDataXMLNode does not support ARC. Go to Build Phrases, under Compile Sourcesmenu look for GDataXMlNode.mset a Compiler Flag for it with: -fno-objc-arc Compiler Flag for not approve ARCNow, for any sub-project you want to use this library, just go to Build Settings, in User Header Search Pathproperties choose: ../IPLibrary/**or ../IPLibraryand choose rescursive option. Set header search path to use libraryNow you can include GDataXMLNode. By the way, your project looks more professional, due to lib and source code is split separately. Good luck.

首先,创建Library.xcodeproject,添加GDataXMLNode。在 中Build Settings,您还包括“标头搜索路径”和“其他链接器标志”。但不要忘记 GDataXMLNode 不支持 ARC。转到Build Phrases,在Compile Sources菜单下查找为它GDataXMlNode.m设置编译器标志:-fno-objc-arc 不批准 ARC 的编译器标志现在,对于要使用此库的任何子项目,只需转到构建设置,在用户Header Search Path属性中选择:../IPLibrary/**../IPLibrary并选择递归选项。 设置标题搜索路径以使用库现在您可以包含 GDataXMLNode。顺便说一句,你的项目看起来更专业,因为lib和源代码是分开的。祝你好运。