Quartz Core Import not required in Xcode 5?

丶灬走出姿态 提交于 2019-12-29 05:09:05

问题


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.


回答1:


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

  • <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).

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



来源:https://stackoverflow.com/questions/20518085/quartz-core-import-not-required-in-xcode-5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!