社区微信群开通啦,扫一扫抢先加入社区官方微信群
社区微信群
platform :ios, '8.0'
use_frameworks!
pod 'ArcGIS-Runtime-SDK-iOS' , '10.2.4'
#用于主界面右下角的about按钮被点击后,滑动显示管用窗口
pod 'PPRevealSideViewController', '~> 1.2.1'
pod 'SwiftyJSON', '~> 2.2.1'
但是这样会产生一个在原来的 iLiveTraffic-Bridging-Header.h 桥接文件
// 建立调用PPRevealSideViewController工具包的桥接 - begin
#import "PPRevealSideViewController.h"
// 建立调用PPRevealSideViewController工具包的桥接 - end
// 建立调用 AFNetWorking 工具包的桥接 -begin
#import "AFNetWorking.h"
// 建立调用 AFNetWorking 工具包的桥接 -end
无法编译,报告PPRevealSideViewController.h没有发现的错误。
如果在PodFile里面去掉use_frameworks!和pod ‘SwiftyJSON’, ‘~> 2.2.1’则项目可以正常运行。
说明这个问题是由于 use_frameworks!引起的。
经过一天的google。发现了这个博文
http://www.innerexception.com/2015/05/cocoapods-useframeworks-means-bridging.html
大致意思是:
如果在cocoapods 里面不使用 use_frameworks!,则是通过static libraries 这个方式来管理pod的代码。这样就需要在app-Bridging-Header.h 文件里面去import相应的.h 文件。而如果使用了use_frameworks!,则cocoapods 使用了frameworks 来取代static libraries 方式。
这样的话,我们就可以通过下面3个步骤去解决这个问题。
- 修改iLiveTraffic-Bridging-Header.h文件,去掉已经frame化的桥接
#ifndef iLiveTraffic_Bridging_Header_h
#define iLiveTraffic_Bridging_Header_h
// 建立调用讯飞工具包的桥接 - begin
#import "iflyMSC/IFlySpeechRecognizerDelegate.h"
#import "iflyMSC/IFlySpeechRecognizer.h"
#import "iflyMSC/IFlyRecognizerViewDelegate.h"
#import "iflyMSC/IFlyRecognizerView.h"
#import "iflyMSC/IFlyContact.h"
#import "iflyMSC/IFlyUserWords.h"
#import "iflyMSC/IFlyDataUploader.h"
#import "iflyMSC/IFlyDataDownloader.h"
#import "iflyMSC/IFlySpeechSynthesizerDelegate.h"
#import "iflyMSC/IFlySpeechSynthesizer.h"
#import "iflyMSC/IFlySpeechUtility.h"
#import "iflyMSC/IFlySpeechConstant.h"
#import "iflyMSC/IFlySpeechError.h"
#import "iflyMSC/IFlySpeechUnderstander.h"
#import "iflyMSC/IFlyTextUnderstander.h"
#import "iflyMSC/IFlySetting.h"
// 建立调用讯飞工具包的桥接 - end
// 建立调用PPRevealSideViewController工具包的桥接 - begin
//#import "PPRevealSideViewController.h" //已经通过cocoapods的use_frameworks!来进行管理,不需要建立桥接了
// 建立调用PPRevealSideViewController工具包的桥接 - end
// 建立调用 AFNetWorking 工具包的桥接 -begin
//#import "AFNetWorking.h" //已经通过cocoapods的use_frameworks!来进行管理,不需要建立桥接了
// 建立调用 AFNetWorking 工具包的桥接 -end
#endif
import PPRevealSideViewController
import AFNetworking
var manager:AFHTTPRequestOperationManager = Tools.getAFHTTPRequestOperationManager()
- 现在的
var manager:AFNetworking.AFHTTPRequestOperationManager = Tools.getAFHTTPRequestOperationManager()
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!