Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't compile code when working with CALayer

For some reason I get linker errors when I try and use CALayer:

  "_OBJC_CLASS_$_CALayer", referenced from: 

I have imported the following headers:

#import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #import <QuartzCore/QuartzCore.h> 

Code:

arrowImage = [[CALayer alloc] init]; 
like image 519
Sheehan Alam Avatar asked Jun 03 '10 16:06

Sheehan Alam


1 Answers

Make sure you also add the QuartzCore framework to your target. Just importing the header isn't enough.

XCode Screenshot enter image description here

like image 74
Cory Kilger Avatar answered Sep 18 '22 03:09

Cory Kilger