将 Google Objective-C API 'GTL' 添加到 iPhone 项目 [英] Adding Google Objective-C API 'GTL' to iPhone project

查看:35
本文介绍了将 Google Objective-C API 'GTL' 添加到 iPhone 项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将 Google Drive API 添加到我的 iPhone 项目中以便我可以使用它?

How to I add the Google Drive API to my iPhone project to I can use it?

到目前为止,我已经将 GTL 项目拖到了我当前的应用项目中(以便它嵌套在我的应用项目下).然后,在我的应用程序目标的构建阶段,我添加了 GTL.framework,然后将 GTL.framework 添加到我的Link binary with Libraries"(见附图).这会引发以下错误:

So far, I have dragged the GTL project into my current app project (so that it is nested under my app project). Then, under my app target's build phases, I added GTL.framework, and then added GTL.framework to my 'Link binary with Libraries' (see attached pic). This throws the following error:

clang: error: no such file or directory: '/Users/xxx/Library/Developer/Xcode/DerivedData/Golf-hfbczyaemhyzgvbrtgdxqnlzeuaa/Build/Products/Debug-iphonesimulator/GTL/GTL'

我该如何解决这个问题?

How to I fix this?

推荐答案

我也遇到了这个错误消息.我是这样解决的:

I struggled with this error message as well. This is how I solved it:

确保您已在 GTLSource/Common/下为您正在使用的服务添加文件夹(例如,为 GoogleDrive 添加 Drive 文件夹).

Make sure you have added the folder for the service that you are using under GTLSource/Common/ (e.g., add the Drive folder for GoogleDrive).

在 GTL.xcodeproj(您已经添加到您的工作区)下找到 GTLSource 文件夹并将其拖到您的主项目(在您的情况下为 Golf).大功告成!

Under GTL.xcodeproj (that you have already added to your workspace) find the GTLSource folder and drag it to your main project (Golf in your case). Done!

现在您可以删除对已添加到工作区的 GTL.xcodeproj 的引用.

Now you can remove references to the GTL.xcodeproj that you have added to the workspace.

使用这种方法,您甚至不需要添加库(因此,如果已添加,请将它们从链接库列表中删除).

With this approach, you don't even need to add the libraries (so remove them from the list of linked libraries if you have added them).

Google API 文档与 Apple 的文档完全不同(不好).

The Google API documentation is nothing like Apple's documentation (it's not good).

我还应该提到,我正在为 iOS 而不是 MacOSX 构建一个应用程序,但这也应该适用于 OSX.

I should also mention that I'm building an app for iOS and not MacOSX, but this should work for OSX as well.

这篇关于将 Google Objective-C API 'GTL' 添加到 iPhone 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆