I am new to iphone app development. I want to add two different delegates.
I know how to add multiple delegates of same class like
UIViewController .
I want like this
@interface HelloWorld : CCLayer, UIViewController
in which one class is CCLayer of cocos2d and second one simple UIViewController.
Thanks in advance for help.
I am new to iphone app development. I want to add two different delegates.
Share
I’m not familiar with CCLayer but you can’t do multiple inheritance in Obj-C (so you can’t have two superclasses). What you can do is create two classes, one that subclasses UIViewController and the other subclasses CCLayer and then create a protocol/delegate pattern to allow communication between the two.
http://iosdevelopertips.com/objective-c/the-basics-of-protocols-and-delegates.html