本文介绍了Xcode 5中不需要Quartz Core Import?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天偶然发现了这一点。如果我尝试访问 CALayer 而不导入< QuartzCore / QuartzCore.h> ,我会在Xcode 4.6中收到警告。但是在Xcode 5中工作正常。

Just stumbled across this today. I am getting warnings in Xcode 4.6 if I try to access the CALayer without importing <QuartzCore/QuartzCore.h>. The same however works fine in Xcode 5.

推荐答案

是,< QuartzCore / QuartzCore.h> 是自动包含的,
但这似乎比预期更多的副作用,因为
只是间接包含:

Yes, <QuartzCore/QuartzCore.h> is automatically included,but this seems to be more a side effect than intended, becauseit is included only indirectly:


  • < UIKit / UIKit.h> 包含< UIKit / UISlider.h>

  • < UIKit / UISlider.h> 包含< ; QuartzCore / QuartzCore.h>
    由于 UISlider 类中的新实例变量( CAShapeLayer 类型)。

  • <UIKit/UIKit.h> includes <UIKit/UISlider.h>,
  • in the iOS 7 SDK, <UIKit/UISlider.h> includes <QuartzCore/QuartzCore.h>,due to new instance variables in the UISlider class (of the CAShapeLayer type).

此外,Xcode 5有一个新的构建设置Link Frameworks Automatically,这是由
默认开启(并需要新的模块功能),因此QuartzCore框架
也被添加到链接库中。

In addition, Xcode 5 has a new build setting "Link Frameworks Automatically", which is bydefault on (and requires the new "modules" feature), so that the QuartzCore frameworkis also added to the link libraries.

这篇关于Xcode 5中不需要Quartz Core Import?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-25 08:42