将 Facebook Connect 添加到我的 iPhone 项目
我在将 Facebook Connect 添加到我的 iPhone 项目时遇到问题。这是目录结构:
-> MyProject
----> MyProject.xcodeproj
----> fbconnect-iphone
----> build/
----> <other files and folders>
按照指示,
- 我打开了 fbconnect-iphone/src/FBConnect.xcodeproj 项目文件。
- 我将 FBConnect 组拖到我的应用程序的 Xcode 项目中。
- 我将“将项目复制到目标组的文件夹(如果需要)”复选框保持关闭状态。
按照指示,
- 我转到“项目”>“编辑项目设置。
- 在搜索路径类别中查找“标题搜索路径”。
- 添加了“../../fbconnect-iphone/src”。保持递归复选框处于关闭状态。
我使用“构建”按钮来检查到目前为止是否一切正常。不是/不是。它给了我 16 个警告和 101 个错误。
我在这里缺少什么? 我正在使用 iPhone SDK 3.0。 Xcode 3.1.3。
问候。
I'm having trouble adding Facebook Connect to my iPhone Project. Here's the directory structure:
-> MyProject
----> MyProject.xcodeproj
----> fbconnect-iphone
----> build/
----> <other files and folders>
As directed,
- I opened fbconnect-iphone/src/FBConnect.xcodeproj project file.
- I dragged the FBConnect group into my application's Xcode project.
- I kept "Copy items into destination group's folder (if needed)" checkbox OFF.
As directed,
- I went to Projects > Edit Project Settings.
- Looked for "Header Search Path" in Search Paths category.
- Added "../../fbconnect-iphone/src". Kept Recursive checkbox OFF.
I used "Build" button to check if everything is fine so far. It wasn't/isn't. It give me 16 warnings and 101 errors.
What am i missing here?
I'm using iPhone SDK 3.0. Xcode 3.1.3.
Regards.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
不知何故,相对路径“../../fbconnect-iphone/src”不起作用,但绝对路径可以解决问题。我仍然想知道是否可以避免所有这些麻烦。
Somehow the relative path "../../fbconnect-iphone/src" is not working, but absolute path does the trick. I still wonder if all this hassle can be avoided.
我让你提到的步骤在一个项目中完美运行,但在另一个项目中却导致了 100 多个错误,如上所述。我进入 FBConnect 类并从导入行的路径中手动删除 FBConnect 文件夹。所以 #import "FBConnect/FBConnect.h" 变成了 #import "FBConnect.h",现在一切正常了。去算算吧。
I had the steps you mentioned work perfectly in one project, and in another it caused 100+ errors as mentioned above. I went into the FBConnect classes and manually removed the FBConnect folder from the paths in the import lines. So #import "FBConnect/FBConnect.h" became #import "FBConnect.h", and now everything works. Go figure.
您的相对路径看起来不正确。它需要与项目文件相关。在您的情况下,“fbconnect-iphone”文件夹与您的项目文件位于同一位置,因此这应该可以解决问题:
fbconnect-iphone/src
(即没有../. ./
开头)。Your relative path doesn't look correct. It needs to be relative to the project file. In your case the "fbconnect-iphone" folder resides in the same place as your project file, so this should do the trick:
fbconnect-iphone/src
(i.e. without the../../
at the beginning).将以下给定路径放入目标信息中的“用户标头搜索路径”中。
“$(SRCROOT)/这是您的 FBConnect 的路径”。
这对我有用。
Place the given below path in "User Header Search Paths" in Target info.
"$(SRCROOT)/HERE IS THE PATH OF YOUR FBConnect".
It worked for me.
我必须做和@ashack 一样的事情。我将所有文件添加到项目中并更改了所有 #import 语句以反映这一点。
I had to do the same thing as @ashack. I added all the files to the project and changed all the #import statements to reflect this.