Reputation: 15992
I'm trying to set a color scale for my view's background, after some research I've found this thread : Gradients on UIView and UILabels On iPhone
But when I add the following line :
CAGradientLayer *gradient = [CAGradientLayer layer];
I get this :
"_OBJC_CLASS_$_CAGradientLayer", referenced from: clang: error: linker command failed with exit code 1 (use -v to see invocation)
What is this error ? And how to solve it ?
Upvotes: 1
Views: 903
Reputation: 12890
It sounds like your project has not got the Quartzcore framework added to it.
Add the framework by (see image)
The dialogue should autocomplete for you.
Lastly, once you have done that you need to import the framework header file wherever you wish to use it (or slam it in the project.pch)
#import <QuartzCore/CoreAnimation.h>
Upvotes: 1
Reputation: 18513
You need to add QuartzCore.framework to your project.
Don't forget to import it into your code also (in your view controller's .h file):
#import <QuartzCore/CoreAnimation.h>
Upvotes: 1