我从 GitHub 下载示例项目,按照说明基本上将 SDK 复制并粘贴到我的应用程序中,但缺少框架。
此外,如果我只是像 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.
当我构建应用程序时,出现以下错误:
我曾尝试将 SquarePointOfSaleSDK.h
添加到 Linked Frameworkds 和 Libraries,但没有成功。
有什么想法吗?
最佳答案
- 克隆 https://github.com/square/SquarePointOfSaleSDK-iOS repo
将目录复制到项目的根目录中。 (见图 1)。通常,这是包含
<YourAppName>.xcodeproj
的同一个文件夹。文件。在 XCode 的文件资源管理器中,将复制的 SquarePointOfSaleSDK 目录拖到您应用的项目中 > 选择“创建组”> 选中应用目标旁边的“添加到目标”
在 Build Settings 下(见图 2),将 $(SRCROOT) 添加到 User Header Search Path build settings > 将其设置为递归搜索子文件夹。 > 将目标的Always Search User Paths build设置标志设置为 YES
在任何依赖的头文件/实现文件中使用以下导入声明:
#import <SquarePointOfSaleSDK/SquarePointOfSaleSDK.h>
图 1:添加 SquarePointOfSaleSDK 组和文件后的文件资源管理器:
图 2:build设置
关于ios - 导入 Square SDK 时克隆和复制方法不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43480767/