1

スケジューラーを使用して、シーンからメインメニューに戻りました。シーンページにはメニュー以外は何もありません。しかし、シーンをナビゲートすると、シーンの割り当てが解除されず、メモリリークが増加します。そのため、アプリケーションは閉じていません(iphone / ipodボタンを使用して閉じるときにバックグラウンドで実行され続けます)が、クラッシュします。

この種の問題に直面して解決したことを願っています。ここから抜け出す方法を期待しています。

これが私のクラスの情報源です-

委任者

@implementation BubbleWordAppDelegate

@synthesize window;

- (void) applicationDidFinishLaunching:(UIApplication*)application
{
    CC_DIRECTOR_INIT();

    // Obtain the shared director in order to...
    CCDirector *director = [CCDirector sharedDirector];

    // Sets landscape mode
    //[director setDeviceOrientation:kCCDeviceOrientationLandscapeLeft];

    // Turn on display FPS
    [director setDisplayFPS:NO];

    // Turn on multiple touches
    EAGLView *view = [director openGLView];
    [view setMultipleTouchEnabled:YES];

    // Default texture format for PNG/BMP/TIFF/JPEG/GIF images
    // It can be RGBA8888, RGBA4444, RGB5_A1, RGB565
    // You can change anytime.
    [CCTexture2D setDefaultAlphaPixelFormat:kTexture2DPixelFormat_RGBA8888];    

//  [[CCDirector sharedDirector] runWithScene: [MainGameLayer scene]];
    [[CCDirector sharedDirector] runWithScene: [MenuScene node]];

}

- (void)applicationWillResignActive:(UIApplication *)application {
    [[CCDirector sharedDirector] pause];
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
    [[CCDirector sharedDirector] resume];
}

- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application {
    [[CCTextureCache sharedTextureCache] removeUnusedTextures];
}

- (void)applicationWillTerminate:(UIApplication *)application {
    [[CCDirector sharedDirector] end];
}

- (void)applicationSignificantTimeChange:(UIApplication *)application {
    [[CCDirector sharedDirector] setNextDeltaTimeZero:YES];
}

- (void)dealloc {
    [[CCDirector sharedDirector] release];
    [window release];
    [super dealloc];
}

@end

メニューシーン

#import "cocos2d.h"
#import "MenuScene.h"
#import "SettingsScene.h"
#import "AboutScene.h"
//#import "MainGameLayer.h"
#import "ErgoTransitions.h"

@implementation MenuScene

- (id) init
{
    self = [super init];
    if (self != nil) {
//      CCMenuItem *menuItem1 = [CCMenuItemFont itemFromString:@"Play" target:self selector:@selector(onPlay:)];
        CCMenuItem *menuItem2 = [CCMenuItemFont itemFromString:@"Settings" target:self selector:@selector(onSettings:)];
        CCMenuItem *menuItem3 = [CCMenuItemFont itemFromString:@"About" target:self selector:@selector(onAbout:)];

//      CCMenu *menu = [CCMenu menuWithItems:menuItem1, menuItem2, menuItem3, nil];
        CCMenu *menu = [CCMenu menuWithItems: menuItem2, menuItem3, nil];
        [menu alignItemsVertically];
        [self addChild:menu];
    }
    return self;
}
/*
- (void)onPlay:(id)sender
{
    NSLog(@"on play");
    [[CCDirector sharedDirector] replaceScene: [ErgoTransitions randomTransition:[MainGameLayer node]]];

}
*/

- (void)onSettings:(id)sender
{
    NSLog(@"on settings");
    [[CCDirector sharedDirector] replaceScene: [ErgoTransitions PageTransitionForward:[SettingsScene node]]];
//  [[CCDirector sharedDirector] replaceScene: [ErgoTransitions randomTransition:[SettingsScene node]]];
}

- (void)onAbout:(id)sender
{
    NSLog(@"on about");
    [[CCDirector sharedDirector] replaceScene: [ErgoTransitions PageTransitionForward:[AboutScene node]]];
//  [[CCDirector sharedDirector] replaceScene: [ErgoTransitions randomTransition:[AboutScene node]]];
}


@end

シーンについて

#import "cocos2d.h"
#import "AboutScene.h"
#import "MenuScene.h"
#import "ErgoTransitions.h"

@implementation AboutScene

- (id) init
{
    self = [super init];
    if (self != nil) {
        CGSize winSize= [[CCDirector sharedDirector] winSize];

        CCSprite *bg = [CCSprite spriteWithFile:@"background2.png"];
        bg.position = ccp(winSize.width/2,winSize.height/2);
        [self addChild:bg];

        CCLabel *label = [CCLabel labelWithString:@"about scene" fontName:@"Arial" fontSize:20];
        label.position = ccp(winSize.width/2,winSize.height/2);
        [self addChild:label];

        [self schedule:@selector(onEnd:) interval:2];
    }
    return self;
}

- (void)onEnd:(ccTime)dt
{
    [[CCDirector sharedDirector] replaceScene: [ErgoTransitions PageTransitionBackward:[MenuScene node]]];
//  [[CCDirector sharedDirector] replaceScene: [ErgoTransitions randomTransition:[MenuScene node]]];
}


@end

トランザクションクラス(cocos2d TestTransitionsから)

#import "cocos2d.h"
#import "ErgoTransitions.h"


#define TRANSITION_DURATION (1.2f)

//static int sceneIdx=0;
static NSString *transitions[] = {
    @"CCJumpZoomTransition",
    @"CCCrossFadeTransition",
    @"PageTransitionForward",
    @"PageTransitionBackward",
    @"CCFadeTRTransition",
    @"CCFadeBLTransition",
    @"CCFadeUpTransition",
    @"CCFadeDownTransition",
    @"CCTurnOffTilesTransition",
    @"CCSplitRowsTransition",
    @"CCSplitColsTransition",
    @"CCFadeTransition",
    @"FadeWhiteTransition",
    @"FlipXLeftOver",
    @"FlipXRightOver",
    @"FlipYUpOver",
    @"FlipYDownOver",
    @"FlipAngularLeftOver",
    @"FlipAngularRightOver",
    @"ZoomFlipXLeftOver",
    @"ZoomFlipXRightOver",
    @"ZoomFlipYUpOver",
    @"ZoomFlipYDownOver",
    @"ZoomFlipAngularLeftOver",
    @"ZoomFlipAngularRightOver",
    @"CCShrinkGrowTransition",
    @"CCRotoZoomTransition",
    @"CCMoveInLTransition",
    @"CCMoveInRTransition",
    @"CCMoveInTTransition",
    @"CCMoveInBTransition",
    @"CCSlideInLTransition",
    @"CCSlideInRTransition",
    @"CCSlideInTTransition",
    @"CCSlideInBTransition",
};


@interface FadeWhiteTransition : CCFadeTransition 
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s;
@end
@interface FlipXLeftOver : CCFlipXTransition 
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s;
@end
@interface FlipXRightOver : CCFlipXTransition 
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s;
@end
@interface FlipYUpOver : CCFlipYTransition 
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s;
@end
@interface FlipYDownOver : CCFlipYTransition 
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s;
@end
@interface FlipAngularLeftOver : CCFlipAngularTransition 
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s;
@end
@interface FlipAngularRightOver : CCFlipAngularTransition 
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s;
@end
@interface ZoomFlipXLeftOver : CCZoomFlipXTransition 
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s;
@end
@interface ZoomFlipXRightOver : CCZoomFlipXTransition 
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s;
@end
@interface ZoomFlipYUpOver : CCZoomFlipYTransition 
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s;
@end
@interface ZoomFlipYDownOver : CCZoomFlipYTransition 
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s;
@end
@interface ZoomFlipAngularLeftOver : CCZoomFlipAngularTransition 
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s;
@end
@interface ZoomFlipAngularRightOver : CCZoomFlipAngularTransition 
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s;
@end
@interface PageTransitionForward : CCPageTurnTransition
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s;
@end
@interface PageTransitionBackward : CCPageTurnTransition
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s;
@end


@implementation FlipXLeftOver
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s {
    return [self transitionWithDuration:t scene:s orientation:kOrientationLeftOver];
}
@end
@implementation FadeWhiteTransition
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s {
    return [self transitionWithDuration:t scene:s withColor:ccWHITE];
}
@end

@implementation FlipXRightOver
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s {
    return [self transitionWithDuration:t scene:s orientation:kOrientationRightOver];
}
@end
@implementation FlipYUpOver
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s {
    return [self transitionWithDuration:t scene:s orientation:kOrientationUpOver];
}
@end
@implementation FlipYDownOver
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s {
    return [self transitionWithDuration:t scene:s orientation:kOrientationDownOver];
}
@end
@implementation FlipAngularLeftOver
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s {
    return [self transitionWithDuration:t scene:s orientation:kOrientationLeftOver];
}
@end
@implementation FlipAngularRightOver
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s {
    return [self transitionWithDuration:t scene:s orientation:kOrientationRightOver];
}
@end
@implementation ZoomFlipXLeftOver
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s {
    return [self transitionWithDuration:t scene:s orientation:kOrientationLeftOver];
}
@end
@implementation ZoomFlipXRightOver
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s {
    return [self transitionWithDuration:t scene:s orientation:kOrientationRightOver];
}
@end
@implementation ZoomFlipYUpOver
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s {
    return [self transitionWithDuration:t scene:s orientation:kOrientationUpOver];
}
@end
@implementation ZoomFlipYDownOver
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s {
    return [self transitionWithDuration:t scene:s orientation:kOrientationDownOver];
}
@end
@implementation ZoomFlipAngularLeftOver
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s {
    return [self transitionWithDuration:t scene:s orientation:kOrientationLeftOver];
}
@end
@implementation ZoomFlipAngularRightOver
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s {
    return [self transitionWithDuration:t scene:s orientation:kOrientationRightOver];
}
@end

@implementation PageTransitionForward
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s {
    return [self transitionWithDuration:t scene:s backwards:NO];
}
@end

@implementation PageTransitionBackward
+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s {
    return [self transitionWithDuration:t scene:s backwards:YES];
}
@end

@implementation ErgoTransitions

+(id) transitionWith:(NSString *) transitionName scene:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(transitionName);
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id) randomTransition:(CCScene*) scene withDuration:(ccTime) duration
{       
    short selectedTransition = [ErgoTransitions getRandomNumber:0 to:((short)sizeof(transitions) / (short)sizeof(transitions[0]))];
    Class transitionClass = NSClassFromString(transitions[selectedTransition]);
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id) JumpZoomTransition:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"CCJumpZoomTransition");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)CrossFadeTransition:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"CCCrossFadeTransition");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)PageTransitionForward:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"PageTransitionForward");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)PageTransitionBackward:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"PageTransitionBackward");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)FadeTRTransition:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"CCFadeTRTransition");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)FadeBLTransition:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"CCFadeBLTransition");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)FadeUpTransition:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"CCFadeUpTransition");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)FadeDownTransition:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"CCFadeDownTransition");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)TurnOffTilesTransition:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"CCTurnOffTilesTransition");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)SplitRowsTransition:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"CCSplitRowsTransition");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)SplitColsTransition:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"CCSplitColsTransition");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)FadeTransition:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"CCFadeTransition");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)FadeWhiteTransition:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"FadeWhiteTransition");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)FlipXLeftOver:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"FlipXLeftOver");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)FlipXRightOver:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"FlipXRightOver");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)FlipYUpOver:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"FlipYUpOver");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)FlipYDownOver:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"FlipYDownOver");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)FlipAngularLeftOver:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"FlipAngularLeftOver");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)FlipAngularRightOver:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"FlipAngularRightOver");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)ZoomFlipXLeftOver:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"ZoomFlipXLeftOver");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)ZoomFlipXRightOver:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"ZoomFlipXRightOver");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)ZoomFlipYUpOver:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"ZoomFlipYUpOver");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)ZoomFlipYDownOver:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"ZoomFlipYDownOver");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)ZoomFlipAngularLeftOver:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"ZoomFlipAngularLeftOver");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)ZoomFlipAngularRightOver:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"ZoomFlipAngularRightOver");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)ShrinkGrowTransition:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"CCShrinkGrowTransition");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)RotoZoomTransition:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"CCRotoZoomTransition");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)MoveInLTransition:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"CCMoveInLTransition");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)MoveInRTransition:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"CCMoveInRTransition");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)MoveInTTransition:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"CCMoveInTTransition");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)MoveInBTransition:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"CCMoveInBTransition");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)SlideInLTransition:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"CCSlideInLTransition");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id)SlideInRTransition:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"CCSlideInRTransition");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id) SlideInTTransition:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"CCSlideInTTransition");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
+(id) SlideInBTransition:(CCScene*) scene withDuration:(ccTime) duration
{       
    Class transitionClass = NSClassFromString(@"CCSlideInBTransition");
    return [transitionClass transitionWithDuration:duration scene:scene];
}
//------ OverLoaded without Direction
+(id) transitionWith:(NSString *) transitionName scene:(CCScene*) scene
{       
    return [ErgoTransitions transitionWith:transitionName  scene:scene withDuration:TRANSITION_DURATION];
}
+(id) randomTransition:(CCScene*) scene
{       
    return [ErgoTransitions randomTransition:scene withDuration:TRANSITION_DURATION];
}
+(id) JumpZoomTransition:(CCScene*) scene
{       
    return [ErgoTransitions JumpZoomTransition:scene withDuration:TRANSITION_DURATION];
}
+(id)CrossFadeTransition:(CCScene*) scene
{       
    return [ErgoTransitions CrossFadeTransition:scene withDuration:TRANSITION_DURATION];
}
+(id)PageTransitionForward:(CCScene*) scene
{       
    return [ErgoTransitions PageTransitionForward:scene withDuration:TRANSITION_DURATION];
}
+(id)PageTransitionBackward:(CCScene*) scene
{       
    return [ErgoTransitions PageTransitionBackward:scene withDuration:TRANSITION_DURATION];
}
+(id)FadeTRTransition:(CCScene*) scene
{       
    return [ErgoTransitions FadeTRTransition:scene withDuration:TRANSITION_DURATION];
}
+(id)FadeBLTransition:(CCScene*) scene
{       
    return [ErgoTransitions FadeBLTransition:scene withDuration:TRANSITION_DURATION];
}
+(id)FadeUpTransition:(CCScene*) scene
{       
    return [ErgoTransitions FadeUpTransition:scene withDuration:TRANSITION_DURATION];
}
+(id)FadeDownTransition:(CCScene*) scene
{       
    return [ErgoTransitions FadeDownTransition:scene withDuration:TRANSITION_DURATION];
}
+(id)TurnOffTilesTransition:(CCScene*) scene
{       
    return [ErgoTransitions TurnOffTilesTransition:scene withDuration:TRANSITION_DURATION];
}
+(id)SplitRowsTransition:(CCScene*) scene
{       
    return [ErgoTransitions SplitRowsTransition:scene withDuration:TRANSITION_DURATION];
}
+(id)SplitColsTransition:(CCScene*) scene
{       
    return [ErgoTransitions SplitColsTransition:scene withDuration:TRANSITION_DURATION];
}
+(id)FadeTransition:(CCScene*) scene
{       
    return [ErgoTransitions FadeTransition:scene withDuration:TRANSITION_DURATION];
}
+(id)FadeWhiteTransition:(CCScene*) scene
{       
    return [ErgoTransitions FadeWhiteTransition:scene withDuration:TRANSITION_DURATION];
}
+(id)FlipXLeftOver:(CCScene*) scene
{       
    return [ErgoTransitions FlipXLeftOver:scene withDuration:TRANSITION_DURATION];
}
+(id)FlipXRightOver:(CCScene*) scene
{       
    return [ErgoTransitions FlipXRightOver:scene withDuration:TRANSITION_DURATION];
}
+(id)FlipYUpOver:(CCScene*) scene
{       
    return [ErgoTransitions FlipYUpOver:scene withDuration:TRANSITION_DURATION];
}
+(id)FlipYDownOver:(CCScene*) scene
{       
    return [ErgoTransitions FlipYDownOver:scene withDuration:TRANSITION_DURATION];
}
+(id)FlipAngularLeftOver:(CCScene*) scene
{       
    return [ErgoTransitions FlipAngularLeftOver:scene withDuration:TRANSITION_DURATION];
}
+(id)FlipAngularRightOver:(CCScene*) scene
{       
    return [ErgoTransitions FlipAngularRightOver:scene withDuration:TRANSITION_DURATION];
}
+(id)ZoomFlipXLeftOver:(CCScene*) scene
{       
    return [ErgoTransitions ZoomFlipXLeftOver:scene withDuration:TRANSITION_DURATION];
}
+(id)ZoomFlipXRightOver:(CCScene*) scene
{       
    return [ErgoTransitions ZoomFlipXRightOver:scene withDuration:TRANSITION_DURATION];
}
+(id)ZoomFlipYUpOver:(CCScene*) scene
{       
    return [ErgoTransitions ZoomFlipYUpOver:scene withDuration:TRANSITION_DURATION];
}
+(id)ZoomFlipYDownOver:(CCScene*) scene
{       
    return [ErgoTransitions ZoomFlipYDownOver:scene withDuration:TRANSITION_DURATION];
}
+(id)ZoomFlipAngularLeftOver:(CCScene*) scene
{       
    return [ErgoTransitions ZoomFlipAngularLeftOver:scene withDuration:TRANSITION_DURATION];
}
+(id)ZoomFlipAngularRightOver:(CCScene*) scene
{       
    return [ErgoTransitions ZoomFlipAngularRightOver:scene withDuration:TRANSITION_DURATION];
}
+(id)ShrinkGrowTransition:(CCScene*) scene
{       
    return [ErgoTransitions ShrinkGrowTransition:scene withDuration:TRANSITION_DURATION];
}
+(id)RotoZoomTransition:(CCScene*) scene
{       
    return [ErgoTransitions RotoZoomTransition:scene withDuration:TRANSITION_DURATION];
}
+(id)MoveInLTransition:(CCScene*) scene
{       
    return [ErgoTransitions MoveInLTransition:scene withDuration:TRANSITION_DURATION];
}
+(id)MoveInRTransition:(CCScene*) scene
{       
    return [ErgoTransitions MoveInRTransition:scene withDuration:TRANSITION_DURATION];
}
+(id)MoveInTTransition:(CCScene*) scene
{       
    return [ErgoTransitions MoveInTTransition:scene withDuration:TRANSITION_DURATION];
}
+(id)MoveInBTransition:(CCScene*) scene
{       
    return [ErgoTransitions MoveInBTransition:scene withDuration:TRANSITION_DURATION];
}
+(id)SlideInLTransition:(CCScene*) scene
{       
    return [ErgoTransitions SlideInLTransition:scene withDuration:TRANSITION_DURATION];
}
+(id)SlideInRTransition:(CCScene*) scene
{       
    return [ErgoTransitions SlideInRTransition:scene withDuration:TRANSITION_DURATION];
}
+(id) SlideInTTransition:(CCScene*) scene
{       
    return [ErgoTransitions SlideInTTransition:scene withDuration:TRANSITION_DURATION];
}
+(id) SlideInBTransition:(CCScene*) scene
{       
    return [ErgoTransitions SlideInBTransition:scene withDuration:TRANSITION_DURATION];
}

+(short)getRandomNumber:(short)from to:(short)to 
{

    return (short)from + arc4random() % (to-from+1);

}

@end

漏れのスクリーンショット-

代替テキスト

編集:

トランジションを削除しました-まだリークがあり、上記で説明したようにアプリが閉じていません-これがスクリーンショットです

代替テキスト

4

1 に答える 1

0

ああ!メモリリークが解決されます。ここで1つの問題が残っています-iPhoneのホームボタン(唯一のボタン)を押してアプリを閉じた後、アプリがバックグラウンドで実行されます。

メモリリークの解決方法:

シンプルですがトリッキーでした。それはタッチディスパッチャーとスケジューラーについてでした。

スケジュール解除: スケジュールされたセレクター内からシーンを切り替える場合は、そのセレクターのスケジュールを解除する必要はありません。ただし、スケジュールされたセレクターの外部からシーンを切り替える場合、または複数のスケジュールされたセレクターがある場合は、切り替える前にスケジュールを解除する必要があります。

Touch Dispatcherから削除(存在する場合)TouchDispatcherから現在のシーンを削除します

現在のシーンを置き換える前に上記の両方を実行し、正常に動作します。すべてのdeallocは適切に呼び出しています:)

于 2010-10-13T11:29:27.767 に答える