且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

无法在新的 Xcode 项目中安装 Alamofire.“没有这样的模块 Alamofire"

更新时间:2023-01-03 22:06:11

确保你没有从 Alamofire 添加任何文件到你的项目中,除了 Alamofire.xcodeproj

Make sure you haven't added any files from Alamofire to your project except for the Alamofire.xcodeproj

以下是分步说明:

  1. 下载并取消存档 Alamofire
  2. 将 Alamofire 的根文件夹复制到项目的任何子文件夹中.例如,Libs.
  3. 将 Alamofire.xcodeproj 拖放到您的 Xcode 项目中
  4. 打开项目的项目设置,构建阶段窗格,展开目标依赖项部分,并将 Alamofire 添加为新依赖项
  5. 打开 General 窗格,展开 Embedded Binaries 部分,然后添加 Alamofire.framework
  6. import Alamofire//在你的源文件中
  7. Alamofire.request(.GET, "http://httpbin.org/get")//使用 Alamofire