想分享一个 MGTwitterEngine iPhone Xcode 骨架项目吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1324143/
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
Want to share a MGTwitterEngine iPhone Xcode skeleton project?
提问by Troy Sartain
Anyone want to share an Xcode project that has MGTwitterEngine in it? Mine won't compile. Are there certain project settings to set? I just made a stock tab bar app for iPhone and added the MGTwitterEngine files. Tons of compiler errors. What am I missing?
有人想分享一个包含 MGTwitterEngine 的 Xcode 项目吗?我的不会编译。是否需要设置某些项目设置?我刚刚为 iPhone 制作了一个股票标签栏应用程序,并添加了 MGTwitterEngine 文件。大量的编译器错误。我错过了什么?
采纳答案by Troy Sartain
I managed to get the library path right eventually. However, in the end, I got rid of the whole MGTwitterEngine thing and went with the TwitterHelper stuff that I noticed the folks from the Stanford iPhone class using. It uses the synchronous calls and it's not as full-featured. But it's lighter and I understand it better. I just use threading to counter the synchronicity. (Hey, wasn't that a song?!) Anyway, a little JSON code and it's all under control. Most of you are probably going to think I'm a noob but it just feels cleaner and easier to handle. I know there are plenty of good reasons to use MGTwitterEngine.
我最终设法使库路径正确。然而,最后,我摆脱了整个 MGTwitterEngine 的东西,并使用了 TwitterHelper 的东西,我注意到斯坦福 iPhone 班的人们正在使用这些东西。它使用同步调用,但功能不全。但它更轻,我更理解它。我只是使用线程来对抗同步性。(嘿,这不是一首歌吗?!)无论如何,一点点 JSON 代码,一切尽在掌握。你们中的大多数人可能会认为我是一个菜鸟,但它只是感觉更干净,更容易处理。我知道使用 MGTwitterEngine 有很多充分的理由。
Bottom line is, even though I got it to work by getting the library path right, I don't even need to worry about any paths by adding the very small TwitterHelper stuff to my project. Seems more Mac-like than to have to go into too much tinkering (I can already hear the experts saying that setting paths is not too much but I absolutely detest the Project Settings dialog.)
最重要的是,即使我通过正确设置库路径使其工作,我什至不需要通过将非常小的 TwitterHelper 内容添加到我的项目中来担心任何路径。看起来更像 Mac,而不必进行过多的修补(我已经听到专家说设置路径不算太多,但我绝对讨厌“项目设置”对话框。)
回答by Asa
I had same problem. To get it to compile I added "$SDKROOT/usr/include/libxml2"
to the Header Search Paths list. I also checked Recursive checkbox.
我有同样的问题。为了让它编译,我添加"$SDKROOT/usr/include/libxml2"
到 Header Search Paths 列表中。我还选中了递归复选框。
回答by Jonathan Zhan
Make sure that you're adding "$SDKROOT/usr/include/libxml2"
to header search paths in your Target settings and not just the Project.
确保您添加"$SDKROOT/usr/include/libxml2"
到目标设置中的标题搜索路径,而不仅仅是项目。
回答by Surya
You also need to add
您还需要添加
- libxml to Header Search Path ( should be something like /usr/library/libxml2 )
- libxml 到标题搜索路径(应该类似于 /usr/library/libxml2 )
回答by Adam Freeman
I just wanted to add something that tripped me up. You have to make sure the Target header search path is also set because it may override the default project search path headers. If you are unable to find some header files that the path is definitely pointing to correctly in your project search path headers, then this is probably the reason.
我只是想添加一些让我绊倒的东西。您必须确保还设置了 Target 标头搜索路径,因为它可能会覆盖默认的项目搜索路径标头。如果您无法在项目搜索路径标头中找到路径肯定正确指向的某些头文件,那么这可能是原因。
回答by Ben Gottlieb
You're probably missing the libxml library. You need to add that to your linked frameworks. Here's a question that has a little more information, but that's the gist of it.
您可能缺少 libxml 库。您需要将其添加到链接的框架中。这是一个包含更多信息的问题,但这就是它的要点。