xcode Cocoapods - 安装 pod 并验证文件存在后“未找到 MBProgressHUD.h”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26535345/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Cocoapods - 'MBProgressHUD.h not found' after installing pod and verifying file exists
提问by H K
I've added the MBProgressHUDCocoapod to my project. Here is my Podfile:
我已将MBProgressHUDCocoapod添加到我的项目中。这是我的Podfile:
# Uncomment this line to define a global platform for your project
# platform :ios, '8.0'
source 'https://github.com/CocoaPods/Specs.git'
target 'RRiOSApp' do
pod 'MBProgressHUD', '~> 0.8'
end
target 'RRiOSAppTests' do
end
I now have my code open as an Xcode workspace instead of a project. I ran pod install
and get the proper console output:
我现在将代码作为 Xcode 工作区而不是项目打开。我运行pod install
并获得了正确的控制台输出:
Analyzing dependencies
Downloading dependencies
Installing MBProgressHUD (0.9)
Generating Pods project
Integrating client project
I can see that my MBProgressHUD.hfile exists in my Pods target under Pods> MBProgressHUD> MBProgressHUD.h
我可以看到我的MBProgressHUD.h文件存在于Pods> MBProgressHUD> MBProgressHUD.h下的Pods目标中
The issue is that when I add #import MBProgressHUD.h
to a file, I get an error at that line reading "MBProgressHUD.h file not found".
问题是,当我添加#import MBProgressHUD.h
到文件时,我在该行收到错误消息“未找到 MBProgressHUD.h 文件”。
回答by H K
I found the answer here, courtesy of @Ben-G: iOS - Build fails with CocoaPods cannot find header files
我在这里找到了答案,由@Ben-G 提供:iOS - 构建失败,CocoaPods 找不到头文件
I had not set up the Pod config for my test target in addition to my App target.
除了我的 App 目标之外,我还没有为我的测试目标设置 Pod 配置。