开发者

Console Error with CCParallaxNode and crash

开发者 https://www.devze.com 2023-02-05 12:52 出处:网络
I\'m getting an error in the console that reads Assertion failure in -[CCParallaxNode addChild:z:tag:]

I'm getting an error in the console that reads Assertion failure in -[CCParallaxNode addChild:z:tag:] This is for the code

    CGSize winSize = [[CCDirector sharedDirector] winSize];
    node = info;
    voidNode = [CCParall开发者_开发技巧axNode node];
    [voidNode addChild:node z:2 parallaxRatio:ccp(0.0f, 1.0f) positionOffset:ccp(info.contentSize.width/2, info.contentSize.height/2 - winSize.height)];
    [self addChild:voidNode z:2 tag:kTagNode];

Not very familiar with debugging with the console


Why don't you simply put there a breakpoint and see what is happening ? Every time i had such error the problem was trying to add a nil child to the parent (there is an assertation of it in a addChild method

0

精彩评论

暂无评论...
验证码 换一张
取 消