For some reason, whenever I call my CCLayer subclass within a block that is being executed else where the code seems to crash with EXE_BAD_ACCESS.
[[DataModel sharedInstance] saveWithSuccess:^{
CCAlertView *alertView = [[CCAlertView alloc] initWithMessage:@"Unsaved Changes" detail:@"You have unsaved changes, would you like to save?" andButtons:@[@"Save", @"Continue", @"Cancel"]];
alertView.delegate = (id <CCAlertViewDelegate>)self;
[self.controls addChild:alertView z:100 tag:kAlertViewTag];
} failure:^{
CCAlertView *alertView = [[CCAlertView alloc] initWithMessage:@"Save Failed" detail:nil andButtons:@[@"Okay"]];
alertView.delegate = (id <CCAlertViewDelegate>)self;
[self.controls addChild:alertView z:100 tag:kAlertViewTag];
}];
I'm not exactly sure on what I am doing wrong, is it the block that is throwing it off? I use this line on code in other places and it works.