我开始了#34; Cocoa Touch Static Project"与可可豆荚相关。
Podfile:
platform :ios, '8.4'
inhibit_all_warnings!
target 'project' do
pod 'libPusher', '~> 1.6'
end
target 'project' do
end
工作区已由命令" pod install"。
创建然后我在这个工作区创建了un swift项目,并在这个swift项目和Objective-C库项目之间创建了一个Bridge头。
我的快速项目配置:
//:configuration = Debug
SWIFT_OBJC_BRIDGING_HEADER = demo/demo-Bridging-Header.h
//:configuration = Release
SWIFT_OBJC_BRIDGING_HEADER = demo/demo-Bridging-Header.h
当我编译我的swift项目时,我得到了这个错误:
demo-Bridging-Header.h:5:9: In file included from /Users/XYZ/Projets/iOS/project/library/demo/demo/demo-Bridging-Header.h:5:
project.h:10:9: 'Pusher/PTPusherDelegate.h' file not found
Failed to import bridging header '/Users/XYZ/Projets/iOS/project/project/demo/demo/demo-Bridging-Header.h'
你知道为什么swift编译器找不到头文件,我该如何修复呢?
答案 0 :(得分:1)
•您是否运行了pod install
?
安装SocketRocket(0.3.1-beta2)
安装libPusher(1.6)
•您是否打开 demo.xcworkspace (关闭Xcode项目,打开Xcode工作区)
如果是这样,那是正确的demo-Bridging-Header.h
内容:
#import "Pusher.h"
#import "Pusher/PTPusherDelegate.h"