加载Alamofire时出现提示: underlying Objective-C module 'Alamofire' not found
基本操作是按照github 中操作的. https://github.com/Alamofire/Alamofire
但是还是弹出这种提示:
其实加载Alamofire很简单.
1. 进入到工程目录,把Alamofire放到工程目录,或者在终端通过: git submodule add https://github.com/Alamofire/Alamofire.git 把文件下载到工程目录
2. 打开Alamofire 目录,然后将Alamofire.xcodeproj 拖到 xcode 的工程目录.
3. 点击左侧导航工程名字, 点击右侧 Build Phases 找到"Link Binary with Libraries" 组,然后添加 Alamofire.framework
.
4. 点击这个页面左上角的加 ,添加一条Build Phases - New Copy Files Phase ,名字改为Copy Frameworks, "Destination" 设置为 "Frameworks",把 这个framework添加进来
官方是说在the Link Binary With Libraries 中添加,其实都可以.
重点是: 如果当前在真机测试环境下,需要切换到模拟器中编译,然后切换回真机即可.