集成 Dropbox SDK 时遇到一次性问题?
我已经下载了适用于 Objective-C/iOS 设备的 Dropbox API,并且能够成功构建并运行 DBRoulette 应用程序。
当我按照 README 说明将 API 包含在我的项目中时,我遇到了大量构建错误,所有这些错误似乎都与缺少 Foundation 标头有关。 (例如,找不到 NSObject、NSString 等的接口声明。)
它们的许多头文件根本不包含任何其他头文件。如果所有 .h 文件扩展了 NSObject,不是都需要导入 Foundation.h 吗?情况似乎并非如此,因为示例项目(DBRoulette)在没有 Foundation 标头声明的情况下构建并运行良好,但我自己的应用程序却严重失败。
我一定是缺少某种项目设置,但我无法确定它是什么。
I have downloaded the Dropbox API for Objective-C/iOS devices, and I am able to successfully build and run the DBRoulette application.
When I follow the README directions for including the API in my project, I have an enormous number of build errors, all appearing to be related to missing the Foundation header. (Eg. Can't find the interface declaration for NSObject, NSString, etc.)
Many of their header files don't include any other headers at all. Don't all .h files need to import Foundation.h if they extend NSObject? This doesn't seem to be the case, as the example project (DBRoulette) builds and runs fine without the Foundation header declarations, but my own application fails miserably.
I must be missing some sort of project setting, but I can't determine what it is.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在他们的示例应用程序中,他们有
前缀头文件(DBRoulette_Prefix.pch)。该文件会自动作为项目中所有源文件的前缀,因此可以找到适当的标头。您可以将
#import
指令放入源文件本身,或者执行它们所做的操作并编辑项目的 .pch 文件。In their example app, they have
in their prefix header file (DBRoulette_Prefix.pch). This file is automatically prefixed to all source files in the project, so the appropriate headers are found. You can either put the
#import
directives in the source files themselves, or do what they did and edit the .pch file for your project.