2012-02-28 83 views

回答

3

,你可以嘗試調用像

- (void) restart 
{ 
    [[CCDirector sharedDirector] replaceScene:[[self class] node]]; 
} 

我認爲,它會工作,但它是不好的。恕我直言,要好得多使用像這樣的版本

- (void) restart 
{ 
    // remove all your content 
    [self removeAllChildrenWithCleanup]; 

    // reinitialize your instances 

    // re-add content again 
    [self addContent]; 
} 
+1

謝謝。 'replaceScene:[[self class] node]];'工作。 – Dalinaum 2013-04-07 07:49:53