Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

CControl.m 'touchDispatcher' issue in Cocos 1.1 #3

Closed
adamlwgriffiths opened this issue Mar 29, 2012 · 2 comments
Closed

CControl.m 'touchDispatcher' issue in Cocos 1.1 #3

adamlwgriffiths opened this issue Mar 29, 2012 · 2 comments

Comments

@adamlwgriffiths
Copy link

Using Kobold2d versions 1.0.4 and 1.1 (cocos 1.1) I get the following error:

Lines 161 and 170 of CCControl.m
Property 'touchDispatcher' not found on object of type 'CCDirector *'

- (void)onEnter
{
#ifdef __IPHONE_OS_VERSION_MAX_ALLOWED
    CCTouchDispatcher * dispatcher = [CCDirector sharedDirector].touchDispatcher;
    [dispatcher addTargetedDelegate:self priority:defaultTouchPriority_ swallowsTouches:YES];
#endif
    [super onEnter];
}

- (void)onExit
{
#ifdef __IPHONE_OS_VERSION_MAX_ALLOWED
    CCTouchDispatcher * dispatcher = [CCDirector sharedDirector].touchDispatcher;
    [dispatcher removeDelegate:self];
#endif

    [super onExit];
}
@adamlwgriffiths
Copy link
Author

This seems to be an error on my part. I was using code from CocosBuilder as a submodule and it's set to use this commit.
https://github.com/vlidholt/CCControlExtension/tree/b31256ad6b26e7f645719f203f0e72d717e68c75
Which is where the error is from. So this is actually a CocosBuilder issue.

Seems I need to l2git.

Cheers,
Adam

Closing because invalid.

@yannickl
Copy link
Owner

yannickl commented Apr 1, 2012

Hi,

For the moment CocosBuilder uses the "gles20" branch of CCControlExtension.
If you want use it with Kobold2d you should use the master branch:

- (void)onEnter
{
#ifdef __IPHONE_OS_VERSION_MAX_ALLOWED
    [[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:defaultTouchPriority_ swallowsTouches:YES];
#endif
    [super onEnter];
}

- (void)onExit
{
#ifdef __IPHONE_OS_VERSION_MAX_ALLOWED
    [[CCTouchDispatcher sharedDispatcher] removeDelegate:self];
#endif

    [super onExit];
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants