Rob
Rob

Reputation: 15992

A gradient shade for my view?

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

Answers (2)

Damo
Damo

Reputation: 12890

It sounds like your project has not got the Quartzcore framework added to it.

Add the framework by (see image)

  1. opening the project settings
  2. Select the Build Phases Tab
  3. Click the + button and then type in quartz in the resultant dialogue.

The dialogue should autocomplete for you.

enter image description here

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

Liam George Betsworth
Liam George Betsworth

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

Related Questions