ios - 导入 Square SDK 时克隆和复制方法不起作用

标签 ios objective-c git square-connect

我从 GitHub 下载示例项目,按照说明基本上将 SDK 复制并粘贴到我的应用程序中,但缺少框架。

enter image description here

此外,如果我只是像 GitHub 所说的那样将包含文件的文件夹拖放到我的应用程序中:

Clone-and-Copy

You can always just clone this repository and copy the source files from the SquarePointOfSaleSDK directory into your project, but when using this approach, you must manually keep the SDK up-to-date yourself.

enter image description here

当我构建应用程序时,出现以下错误:

enter image description here

我曾尝试将 SquarePointOfSaleSDK.h 添加到 Linked Frameworkds 和 Libraries,但没有成功。

有什么想法吗?

最佳答案

  1. 克隆 https://github.com/square/SquarePointOfSaleSDK-iOS repo
  2. 将目录复制到项目的根目录中。 (见图 1)。通常,这是包含 <YourAppName>.xcodeproj 的同一个文件夹。文件。

  3. 在 XCode 的文件资源管理器中,将复制的 SquarePointOfSaleSDK 目录拖到您应用的项目中 > 选择“创建组”> 选中应用目标旁边的“添加到目标

  4. 在 Build Settings 下(见图 2),将 $(SRCROOT) 添加到 User Header Search Path build settings > 将其设置为递归搜索子文件夹。 > 将目标的Always Search User Paths build设置标志设置为 YES

  5. 在任何依赖的头文件/实现文件中使用以下导入声明: #import <SquarePointOfSaleSDK/SquarePointOfSaleSDK.h>

图 1:添加 SquarePointOfSaleSDK 组和文件后的文件资源管理器:

image of file explorer

图 2:build设置

image of build settings

关于ios - 导入 Square SDK 时克隆和复制方法不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43480767/

相关文章:

ios - XCode iOS——分享一些文本到另一个应用程序——只有邮件和短信选项可用

iOS - 自定义表格单元格不是 UITableView 的全宽

git - .gitignore 中多个文件扩展名的简写

git - 如何让 git log 显示相对于当前目录的文件路径?

windows - 删除 Bonobo 中损坏的存储库

ios - 如何在 UITableView 中使用 UITableView 作为 ios Objective-C 中的下拉列表

ios - XCode - 指向接口(interface) 'NSTimer' 的指针的算术,对于该架构和平台来说,该指针的大小不是恒定的

python - C 或 Python 中的 NSScanner 等效项

ios - HealthKit 许可表未出现

iphone - 有没有办法在 animateWithDuration 开始后暂停它?