我使用的是swift 3 xCode 8。我的项目名称是jzy_weather2。
当我尝试从Pod导入MBProgressHUD.h时,出现两个错误,一个是MBProgressHUD.h file not found,另一个是failed to import bridging header /myPath/myProj/myProj/myProj-Bridging-Header.h
这是Podfile中的代码,当pod安装时,下面的两个Podfile块都是正常的
platform :ios, '10.0'
def myPods
pod 'MBProgressHUD', '~> 1.0.0'
end
target 'jzy_weather2' do
use_frameworks!
myPods
target 'jzy_weather2Tests' do
inherit! :search_paths
end
target 'jzy_weather2UITests' do
inherit! :search_paths
end
end也试着这样做
platform :ios, '10.0'
def myPods
pod 'MBProgressHUD', '~> 1.0.0'
end
target 'jzy_weather2' do
use_frameworks!
myPods
end
target 'jzy_weather2Tests' do
myPods
end
target 'jzy_weather2UITests' do
myPods
end这是在jzy_weather2-Bridging Header.h中编写的代码
#import "MBProgressHUD.h"我也尝试过这个语法
#import <MBProgressHUD.h>我读过一些像there solutions in StackOverflow这样的解决方案,我不知道我是否在这个链接中错过了一些正确的解决方案,因为它有太多的解决方案。
这是my Project info,我认为这对某些人来说是正确的解决方案,但是My two errors仍然会发生
我的配置或代码有什么问题吗?或者在xCode 8中,我应该编写另一种配置?
发布于 2016-10-24 21:34:17
将这些文件拖放到项目中
MBProgressHUD.h
MBProgressHUD.m
你可以找到这个
https://github.com/jdg/MBProgressHUD
它将在您的应用程序中创建桥接头
例如: jzy_weather -Bridging-Header.h
#import "MBProgressHUD.h“
Swift 3
let loadingMBProgress = MBProgressHUD.showAdded(to: self.view, animated: true)
loadingMBProgress.mode = MBProgressHUDMode.indeterminate
loadingMBProgress.label.text = "Loading"
For hide
MBProgressHUD.hide(for: self.view, animated: true)https://stackoverflow.com/questions/40215008
复制相似问题