ios - 什么是伞头?

标签 ios objective-c

什么是伞头?它的用途是什么?我收到如下所示的警告。这是什么意思?

<module-includes>:1:1: warning: umbrella header for module 'XCTest' does not include header 'XCTextCase+AsynchronousTesting.h' [-Wincomplete-umbrella]
#import "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTest.h"

最佳答案

umbrella header是框架的“主”头文件。它的用途是你可以写

#import <UIKit/UIKit.h>

而不是

#import <UIKit/UIViewController.h>
#import <UIKit/UILabel.h>
#import <UIKit/UIButton.h>
#import <UIKit/UIDatePicker.h>

等等。

对我来说,<XCTest/XCTestCase+AsynchronousTesting.h>包含在 <XCTest/XCTest.h> 中.也许它不适合你?在这种情况下,添加

#import <XCTest/XCTestCase+AsynchronousTesting.h>

手动。

关于ios - 什么是伞头?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31238761/

相关文章:

iphone - 暂停在 uiwebview 中运行的视频 (mp4)

ios - 如何创建一个类以用于不同的项目?

objective-c - 我正在使用 drawRect : how can I draw a button? 实现 UIView 子类

objective-c - 使用计时器播放音频样本

ios - 在 SpriteKit 中检测对象子节点上的触摸

objective-c - 从 UITableView 中删除会使应用程序崩溃

ios - Facebook 显示登录对话框而不是应用程序请求对话框

ios - 将事件从 (UITableViewCell->UIScrollView) 传递给拥有的 UITableView

iphone - 调用 UILocalNotification cancelAllLocalNotifications 是仅取消调用它的应用程序的通知还是所有通知?

ios - Objective-C 循环比较两个文本字段的密码