首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >找不到swift %3 xcode %8 'MBProgressHUD.h‘文件,无法导入桥接头'/myPath/myProj/myProj/myProj-Bridging-Header.h’

找不到swift %3 xcode %8 'MBProgressHUD.h‘文件,无法导入桥接头'/myPath/myProj/myProj/myProj-Bridging-Header.h’
EN

Stack Overflow用户
提问于 2016-10-24 17:29:59
回答 1查看 907关注 0票数 1

我使用的是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块都是正常的

代码语言:javascript
复制
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

也试着这样做

代码语言:javascript
复制
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中编写的代码

代码语言:javascript
复制
#import "MBProgressHUD.h"

我也尝试过这个语法

代码语言:javascript
复制
#import <MBProgressHUD.h>

我读过一些像there solutions in StackOverflow这样的解决方案,我不知道我是否在这个链接中错过了一些正确的解决方案,因为它有太多的解决方案。

这是my Project info,我认为这对某些人来说是正确的解决方案,但是My two errors仍然会发生

我的配置或代码有什么问题吗?或者在xCode 8中,我应该编写另一种配置?

EN

回答 1

Stack Overflow用户

发布于 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

代码语言:javascript
复制
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)
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40215008

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档