Objective-C: Protocols
- by Stu
I'd like an instance variable object to adopt a protocol.
@interface GameScene : Scene <AVAudioPlayerDelegate> {
@private
Layer *content <CocosNodeOpacity>;
}
For example I'd like my Layer object to adopt the <CocosNodeOpacity> so that I can get the methods
-(GLubyte) opacity; //and
-(void) setOpacity: (GLubyte) opacity;
for free. The syntax shown above is invalid. Is it possible to achieve this without creating a new implementation file and creating a custom object? Thanks.