![](/img/trans.png)
[英]Expected a type error in 'myproj'-Bridging-Header.swift
[英]swift 3 xcode 8 'MBProgressHUD.h' file not found failed to import bridging header '/myPath/myProj/myProj/myProj-Bridging-Header.h'
我正在使用swift 3 xCode 8.我的項目名稱是jzy_weather2。
當我嘗試從Pods導入MBProgressHUD.h
,出現TWO錯誤,一個是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>
我已經閱讀了一些解決方案,比如StackOverflow中的解決方案 ,我不知道我是否在這個鏈接中找到了一些正確的解決方案,因為它中有太多的解決方案。
這是我的項目信息 ,我認為這是一個正確的解決方案,但我的兩個錯誤仍然發生
我的配置或代碼有什么問題嗎? 或者也許在xCode 8中,我應該編寫另一種配置?
將這些文件拖放到項目中
MBProgressHUD.h
MBProgressHUD.m
你可以找到這個
https://github.com/jdg/MBProgressHUD
它將在您的應用中創建橋接標題
例如:jzy_weather -Bridging-Header.h
#import“MBProgressHUD.h”
斯威夫特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)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.