ios8 - SpriteKit presentScene crash app -
i navigating between sk scenes using following code:
skscene *newscene = [[myscene alloc] initwithsize:self.size state:state]; float duration = 1; sktransition *transition = [sktransition fadewithduration:duration]; [self.view presentscene:newscene transition:transition];
regardless type of scene trying present, app crashes every time exc_bad_access (code 1) without zombies.. looks "present scene won't work correctly on xcode6, did work before upgraded xcode5
edit: initwithsize code:
-(id)initwithsize:(cgsize)size state:(gamestate)state{ if (self = [super initwithsize:size]) { [self setupscene]; if (state == gamestatelaunch) { [self setuploadingscreen]; [self switchtolaunch]; } else if (state == gamestatetutorial || state == gamestatereplay) { [self switchtotutorial]; } else if (state== gamestatemainmenu) { [self switchtomainmenu]; } } return self; }
i managed make work partially removing children before presenting new scene:
- (void)cleanupchildrenandremove { (sknode *child in self.children) { [child removefromparent]; } [self removefromparent]; }
however, crazy. there must better solution!
Comments
Post a Comment