When I try to activate touch move support by uncommenting following function (as recommended in documentation):
///*
-(void) ccTouchMoved: (UITouch *)touch withEvent: (UIEvent *)event {
[self handleTouch: touch ofType: kCCTouchMoved];
}
//*/
I get compilation error:
No visible @interface for 'CC3HelloWorldLayer' declares the selector 'handleTouch:ofType:'
This function is declared in CCLayer.h from which CC3layer inherits.
What is the cause of that strange error?
The handleTouch:ofType:
method is defined in CC3Layer.m
as a protected method, and needs to be redeclared in any subclass files that use it (it has no public visibility).
The redeclaration is missing from the CC3HelloWorldLayer.m
file due to an oversight. I'll fix that in a future release.
In the meantime, add the following to the top of your CC3HelloWorldLayer.m
file:
@interface CC3Layer (TemplateMethods)
-(BOOL) handleTouch: (UITouch*) touch ofType: (uint) touchType;
@end
See the TileLayer.m
and CC3DemoMashUpLayer.m
files for examples.
...Bill