Skip to content

peterm999/Child-Parent-Cocos2D

Repository files navigation

Child Talking to Parent Class Examples - Cocos2D

by Peter Matthews

Information

Its very easy to create a class and call one of its methods:

SomeClass *newClass = [SomeClass new]; [newClass callMethod];

But how do you get the class you created to talk back to the parent?

As with most coding you will find there are many different ways of tackling the same problem. This code shows three ways of communicating from child to parent:

*Delegation - probably the best and most widely used way of child-parent communication

*Notifications - A very simple way of quickly communicating from one class to another

*Scheduling - A basic way of polling the class repeatedly to maintain communication

Tutorial

I have created a full online tutorial to accompany this code you can find this along with other tutorials at -

www.shakeyourapp.net/developer

About

Cocos2D Project showing three different ways for the child node to communicate with the parent - notifications,delegation,scheduling

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published