Compile error trying to use CAGradientLayer

旧巷老猫 提交于 2019-11-30 13:49:52

问题


I'm trying to use CAGradientLayer and getting an unhelpful compile error. Can't figure out whats wrong. All I'm doing so far is:

CAGradientLayer *gradient = [CAGradientLayer layer];

I've imported <QuartzCore/QuartzCore.h> and I'm getting the warning >

_OBJC_CLASS_$CAGradientLayer referenced from: objc-class-ref-to-CAGradientLayer symbol(s) not found.

I've tried clean and build but no luck and I can't seem to target anything other than 4.1 in Xcode

Cheers for any help.


回答1:


You didn't correctly add the QuartzCore framework into your project:





回答2:


You have to add the QuartzCore-Framework to your project.



来源:https://stackoverflow.com/questions/3902594/compile-error-trying-to-use-cagradientlayer

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