Custom CALayer - invalid context 0x0
I'm trying to build an app that use layers, my app structure is UIView --> UIScrollView --> UIView --> LayersView (Custom UIView) --> UIImageView I want to add multiple layers to the LayersView, so I've build a custom CALayer that use UIBezierPath to draw a set of points. CALayerBezierPath.h #import <QuartzCore/QuartzCore.h> @interface CALayerBezierPath : CALayer { NSMutableArray *pointsArray; } @property (nonatomic, retain) NSMutableArray *pointsArray; - (void) initVariables; - (void) addNewPoints:(CGPoint)newPoint; @end CALayerBezierPath.m #import "CALayerBezierPath.h" @implementation