Cocos2d project crashes when using distribution provisioning profile

107 Views Asked by At

I have used ccbi files for cocos2d animations for the app.

- (void)pressedPlay:(id)sender
{
  CCScene* songScene = [CCBReader sceneWithNodeGraphFromFile:@"SongScene.ccbi"];
  [[CCDirector sharedDirector] replaceScene:songScene];
}

This loads the animation screen. It works perfectly in simulator and actual device by connecting to the xcode. But when running the app by using ipa file(adhoc provisioning profile), It crashes.

This is the part of the SongScene.m.

 @implementation SongScene

- (id) init {
    self = [super init];
    if (self) {

      [[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:0 swallowsTouches:NO];

}
    return self;
}

- (void) didLoadFromCCB
{

starScene = [CCBReader nodeGraphFromFile:@"StarScene.ccbi"];
[self addChild:starScene];

moonScene = [CCBReader nodeGraphFromFile:@"MoonScene.ccbi"];
[self addChild:moonScene];

}

- (void) onEnter
{
    [super onEnter];

    [self schedule:@selector(update:)];

    soundEffectID=[[SimpleAudioEngine sharedEngine] playEffect:@"yyyy.MP3"];

    self.touchEnabled = YES;
  }


- (void) onExit
 {
    [super onExit];
    [[SimpleAudioEngine sharedEngine] stopEffect:soundEffectID];
    [self unscheduleAllSelectors];
 }
0

There are 0 best solutions below