English 中文(简体)
冰s
原标题:Examine cocos2d s nodes tree

我已经结束我的游戏,我正在努力解决一些记忆问题。

我的游戏有36个层次,我注意到,在20-25年之后,当我跑了一架护卫机时,我照相机。 我开始发出记忆警告,在现场之间过渡时总是发生故障。

I have already used instruments to fix every memory leak but this is still happening. My guess is that cocos is still holding references to old objects.

我想找到一种办法,在我的游戏的某些要点中,通过宇宙节点,确保一切顺利。

任何关于如何这样做的想法?

最佳回答

我最后说:

我在<代码>CC Director中添加了“draw”等级:

-(void) printChildren:(CCNode *)node andLevel:(NSInteger)level {

    NSString *tabs = @"";
    for (int i=0; i <level; i++) {
        tabs = [NSString stringWithFormat:@"%@  ", tabs];
    }

    NSLog(@"%@NODE %@. Children count: %d", tabs, node, node.children.count);
    if ( node.children.count == 0 ) {
        return;
    } else {
        for (CCNode *child in node.children) {
            [self printChildren:child andLevel:level+1];
        }
    }
}

-(void) nodeHierarchy
{

    NSLog(@"Printing nodeHierarchy! with an stack of %d scenes", [scenesStack_ count]);
    for (CCScene *scene in scenesStack_) {
        NSLog(@"Scene in stack: %@", [scene class]);
        [self printChildren:scene andLevel:0];
    }
}

nodeHierarchy,载于replaceScene

更有视觉工具是巨大的,但这对我有利。

问题回答

我已修改了CCTextureCache,以记录哪些文本被保留,哪些文本已释放,另一些则在我的游戏中的关键步骤上,即强迫拆除未使用孔径,特别是在现场过渡。 无论你们看到什么情况,都应当对你们的感召。 而且,我倾向于用独一无二的标签打上一切,并记住每个阶层的标签,这些标签给加拿大的联邦法典增加了障碍。 在洗衣场(清理)中,一把tag块 array倒起来,并强行拆除。

任何原因,你都无法迁至具有非洲经共体的SDK 5.0。





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签