EXEC BAD ACCESS调用块时出错(仅限iPad)?

时间:2015-07-11 16:18:21

标签: ios objective-c ipad block exc-bad-access

最近几天,我发现我的应用程序在iPad上崩溃不一致。为了尝试找出原因,我安装了crashlytics并在用户复制崩溃后获得了崩溃报告。

错误是主线程上的EXEC BAD ACCESS错误,相关的行是:__36-[CXScene showGenericPopupWithText:]_block_invoke

查看我的方法'showGenericPopupWithText:',我可以看到它确实调用了一个块:

-(void)showGenericPopupWithText:(NSString *)text
{
    CXPopupMessageNode *message = [[CXPopupMessageNode alloc]initWithMessage:text];
    [message setAlpha:0.0f];
    [self.spriteForStaticGeometry addChild:message];
    [message setPosition:CGPointMake(self.spriteForStaticGeometry.size.width/2 - (message.frame.size.width/2), self.spriteForStaticGeometry.size.height/2)];
    SKAction *fadeIn = [SKAction fadeInWithDuration:0.2];
    SKAction *wait = [SKAction waitForDuration:0.5];
    SKAction *fadeOut = [SKAction fadeOutWithDuration:0.2];
    SKAction *show = [SKAction sequence:@[fadeIn,wait,fadeOut]];
    [message runAction:show completion:^{
        [self.spriteForStaticGeometry removeChildrenInArray:@[message]];
    }];
}

在最后,我运行一个带有完成块的动作,删除CXPopupMessageNode对象。 (SKShapeNode的子类)。我假设这是导致错误发生的原因。

然而,这只发生在某些iPad上,并且在任何测试的iPhone上都不会发生。更重要的是,我不能在模拟器中复制这个,所以我不知道我能做些什么来修复这个错误。任何人都可能知道或了解导致此次崩溃的原因?

感谢您的时间。

编辑:按要求提供的其他信息:

Crashlytics Stack Trace:

Thread : Crashed: com.apple.main-thread
0  SpriteKit                      0x26f9143a -[SKLabelNode hash] + 701
1  SpriteKit                      0x26f9140d -[SKLabelNode hash] + 656
2  CoreFoundation                 0x23b778d7 -[__NSSetI member:] + 62
3  CoreFoundation                 0x23b6610d -[NSSet containsObject:] + 28
4  CoreFoundation                 0x23b7a809 -[NSMutableArray removeObjectsInRange:inArray:range:] + 304
5  CoreFoundation                 0x23b7a663 -[NSMutableArray removeObjectsInArray:] + 154
6  SpriteKit                      0x26f7bb63 -[SKNode removeChildrenInArray:] + 1590
7  AstroKit                       0x00111873 __36-[CXScene showGenericPopupWithText:]_block_invoke (CXScene.m:707)
8  SpriteKit                      0x26f31847 SKCAction::didFinishWithTargetAtTime(SKCSprite*, double) + 38
9  SpriteKit                      0x26f46475 SKCSequence::cpp_updateWithTargetForTime(SKCSprite*, double) + 148
10 SpriteKit                      0x26f9c6a9 SKCSprite::update(double) + 144
11 SpriteKit                      0x26f9c767 SKCSprite::update(double) + 334
12 SpriteKit                      0x26f9c767 SKCSprite::update(double) + 334
13 SpriteKit                      0x26f4cec9 -[SKScene _update:] + 200
14 SpriteKit                      0x26f6a8af -[SKView(Private) _update:] + 686
15 SpriteKit                      0x26f67a45 -[SKView renderCallback:] + 748
16 SpriteKit                      0x26f6485d __29-[SKView setUpRenderCallback]_block_invoke + 116
17 SpriteKit                      0x26f95fcd -[SKDisplayLink _callbackForNextFrame:] + 248
18 QuartzCore                     0x26b3ad7b CA::Display::DisplayLinkItem::dispatch() + 98
19 QuartzCore                     0x26b3abe3 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 366
20 IOMobileFramebuffer            0x2b3c182f IOMobileFramebufferVsyncNotifyFunc + 90
21 IOKit                          0x24b6a51d IODispatchCalloutFromCFMessage + 256
22 CoreFoundation                 0x23bfcbe5 __CFMachPortPerform + 132
23 CoreFoundation                 0x23c0d023 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
24 CoreFoundation                 0x23c0cfbf __CFRunLoopDoSource1 + 346
25 CoreFoundation                 0x23c0b5e1 __CFRunLoopRun + 1608
26 CoreFoundation                 0x23b58db1 CFRunLoopRunSpecific + 476
27 CoreFoundation                 0x23b58bc3 CFRunLoopRunInMode + 106
28 GraphicsServices               0x2aebb051 GSEventRunModal + 136
29 UIKit                          0x27124a31 UIApplicationMain + 1440
30 AstroKit                       0x0011ccdb main (main.m:14)
31 libdyld.dylib                  0x31c11aaf start + 2

0 个答案:

没有答案
相关问题