My class X is interited from CCLayer.
@interface X : CCLayer
Then in X, I added an instance variable of type CAShapeLayer.
CAShapeLayer *_Circle
I drew the Circle using UIBezierPath. Now if I try to add _circle to self, it gives me error:
[self addChild:_Circle];
[CAShapeLayer tag]: unrecognized selector sent to instance 0x916f7f0 * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CAShapeLayer tag]: unrecognized.
I also tried typecasting _Circle to (CCNode*) or (CCSprite*) but nothing helped.
Any suggestions?
CAShapeLayer
is a class. Try[_Circle tag];
. – ott-- Jul 15 at 9:27@interface X : CCLayer
a typo? (CALayer?). And isn't it the other way round, first you create a layer and a sublayer, then you draw a spline between them? See developer.apple.com/library/mac/#documentation/GraphicsImaging/… – ott-- Jul 16 at 9:01