我在同一个项目的 Xcode 6.0 中集成了 Chartboost,它工作正常,但是当我将 Xcode 更新到 Xcode 6.1 时,桥接头文件无法成功编译。
我在我的项目中添加了 Chartboost 框架,并按照指南中的说明添加了这些必需的框架。
StoreKit
基础
核心图形
UIKit
我在桥接头文件中添加了这些行
导入 Chartboost/Chartboost.h
导入 Chartboost/CBNewsfeed.h
导入 CommonCrypto/CommonDigest.h
导入 AdSupport/AdSupport.h
现在,当我尝试构建我的项目时,Xcode 给了我很多 swift 编译器错误。
这是我遇到的错误...
/Users/myprojectBridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:16:42:错误:此处不允许函数定义 typedef NS_ENUM(NSUInteger, CBFramework) { ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:33:42:错误:此处不允许函数定义 typedef NS_ENUM(NSUInteger, CBLoadError) { ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:62:43:错误:此处不允许函数定义 typedef NS_ENUM(NSUInteger, CBClickError) { ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:87:9:错误:未知类型名称'NSString' typedef NSString * 常量 CBLocation; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:135:25:错误:找不到“NSObject”的接口声明,“Chartboost”的超类 @interface Chartboost : NSObject ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:153:25:错误:预期类型 + (void)startWithAppId:(NSString*)appId ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:154:25:错误:预期类型 appSignature:(NSString*)appSignature ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:169:4:错误:预期类型 + (BOOL) 有插页式:(CBLocation) 位置; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:198:4:错误:预期类型 + (BOOL)hasMoreApps:(CBLocation) 位置; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:229:23:错误:预期类型 + (void)showMoreApps:(UIViewController *)viewController ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:244:4:错误:预期类型 + (BOOL)hasRewardedVideo:(CBLocation)位置; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:274:25:错误:预期类型 + (void)didPassAgeGate:(BOOL)pass; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:290:4:错误:预期类型 + (BOOL)handleOpenURL:(NSURL *)url ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:290:24:错误:预期类型 + (BOOL)handleOpenURL:(NSURL *)url ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:291:24:错误:预期类型 sourceApplication:(NSString *)sourceApplication; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:309:4:错误:预期类型 + (BOOL)handleOpenURL:(NSURL *)url ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:309:24:错误:预期类型 + (BOOL)handleOpenURL:(NSURL *)url ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:310:24:错误:预期类型 sourceApplication:(NSString *)sourceApplication ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:322:22:错误:预期类型 + (void)setCustomId:(NSString *)customId; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:333:4:错误:预期类型 + (NSString *)getCustomId; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:344:23:错误:预期类型 + (void)setFramework:(CBFramework)框架; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:358:54:错误:预期类型 + (void)setShouldRequestInterstitialsInFirstSession:(BOOL)shouldRequest; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:370:45:错误:预期类型 + (void)setShouldPauseClickForConfirmation:(BOOL)shouldPause; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:384:49:错误:预期类型 + (void)setShouldDisplayLoadingViewForMoreApps:(BOOL)shouldDisplay; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:396:40:错误:预期类型 + (void)setShouldPrefetchVideoContent:(BOOL)shouldPrefetch; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:446:26:错误:预期类型 + (void)setAutoCacheAds:(BOOL)shouldCache; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:458:4:错误:预期类型 + (BOOL)getAutoCacheAds; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:474:31:错误:找不到“NSObject”的协议声明 @protocol ChartboostDelegate ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:496:4:错误:预期类型 - (BOOL)shouldRequestInterstitial:(CBLocation)位置; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:513:4:错误:预期类型 - (BOOL)shouldDisplayInterstitial:(CBLocation)位置; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:551:36:错误:预期类型 withError:(CBLoadError) 错误; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:565:31:错误:预期类型 withError:(CBClickError) 错误; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:615:4:错误:预期类型 - (BOOL) 应该显示更多应用程序:(CBLocation) 位置; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:686:32:错误:预期类型 withError:(CBLoadError) 错误; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:705:4:错误:预期类型 - (BOOL)shouldDisplayRewardedVideo:(CBLocation)位置; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:743:37:错误:预期类型 withError:(CBLoadError) 错误; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:818:30:错误:预期类型 withError:(CBLoadError) 错误; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:867:4:错误:预期类型 - (BOOL)shouldDisplayMoreApps __attribute__((deprecated("从 4.5 版开始,使用 shouldDisplayMoreApps:(CBLocation)location")));; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:22 中包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/Chartboost.h:937:32:错误:预期类型 - (void)didFailToLoadMoreApps:(CBLoadError)error __attribute__((deprecated("截至 4.5 版,使用 didFailToLoadMoreApps:(CBLoadError)error forLocation:(CBLocation)location"))); ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:23:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:23 包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/CBNewsfeed.h:24:25:错误:找不到“NSObject”的接口声明,“CBNewsfeed”的超类 @interface CBNewsfeed:NSObject ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:23:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:23 包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/CBNewsfeed.h:53:4:错误:预期类型 + (NSArray *)getMessages; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:23:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:23 包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/CBNewsfeed.h:66:26:错误:预期类型 + (CBStory *)getMessage:(NSString *)messageId; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:23:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:23 包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/CBNewsfeed.h:78:4:错误:预期类型 + (NSUInteger)messageCount; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:23:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:23 包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/CBNewsfeed.h:89:4:错误:预期类型 + (NSUInteger)unreadMessageCount; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:23:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:23 包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/CBNewsfeed.h:113:4:错误:预期类型 + (BOOL)isNewsfeedUIVisible; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:23:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:23 包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/CBNewsfeed.h:139:4:错误:预期类型 + (BOOL)isNotificationUIVisible; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:23:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:23 包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/CBNewsfeed.h:180:23:错误:预期类型 + (void)setFetchTime:(NSUInteger)fetchTime; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:23:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:23 包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/CBNewsfeed.h:203:50:错误:预期类型 + (void)setShouldPauseStoryClickForConfirmation:(BOOL)shouldPause; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:23:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:23 包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/CBNewsfeed.h:216:25:错误:预期类型 + (void)didPassAgeGate:(BOOL)pass; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:23:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:23 包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/CBNewsfeed.h:232:31:错误:找不到“NSObject”的协议声明 @protocol CBNewsfeedDelegate ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:23:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:23 包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/CBNewsfeed.h:295:28:错误:预期类型 - (void)didGetNewMessages:(NSArray *)messages; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:23:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:23 包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/CBNewsfeed.h:319:36:错误:预期类型 - (void)didFailToRetrieveMessages:(NSError *)error; ^ /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:23:9:注意:在 /Users/bewakoofmac/Desktop/myproject/Bridging-Header.h:23 包含的文件中: 进口 ^ /Users/bewakoofmac/Desktop/myproject/Chartboost.framework/Headers/CBNewsfeed.h:340:4:错误:预期类型 - (BOOL)应该自动显示通知UI:(CBStory *)消息; ^ :0:错误:无法导入桥接头'/Users/bewakoofmac/Desktop/myproject/Bridging-Header.h'