Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/117.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios Sprite工具包在仅在iPad Air和带视网膜的iPad mini上运行操作/加载资产时崩溃_Ios_Ipad_Air_64 Bit_Sprite Kit - Fatal编程技术网

Ios Sprite工具包在仅在iPad Air和带视网膜的iPad mini上运行操作/加载资产时崩溃

Ios Sprite工具包在仅在iPad Air和带视网膜的iPad mini上运行操作/加载资产时崩溃,ios,ipad,air,64-bit,sprite-kit,Ios,Ipad,Air,64 Bit,Sprite Kit,我收到的事故报告来自retina mini和iPad Air设备,但不是iPhone 5S。它发生在SpriteKit中,当有人点击一个sprite时,这个sprite应该会在屏幕上再次出现 我无法在非A7设备上重现这一点,因此想知道是否有人可以查看下面的崩溃日志,让我知道崩溃可能是由什么引起的 Exception Type: SIGSEGV Exception Codes: SEGV_ACCERR at 0xb000000c Crashed Thread: 0 Thread 0 Cras

我收到的事故报告来自retina mini和iPad Air设备,但不是iPhone 5S。它发生在SpriteKit中,当有人点击一个sprite时,这个sprite应该会在屏幕上再次出现

我无法在非A7设备上重现这一点,因此想知道是否有人可以查看下面的崩溃日志,让我知道崩溃可能是由什么引起的

Exception Type:  SIGSEGV
Exception Codes: SEGV_ACCERR at 0xb000000c
Crashed Thread:  0

Thread 0 Crashed:
0   libobjc.A.dylib                      0x39b30b66 objc_msgSend + 5
1   CoreUI                               0x3349bd0d -[CUIStructuredThemeStore renditionWithKey:] + 1050
2   CoreUI                               0x334a50af -[CUINamedImage _renditionForSpecificKey:] + 168
3   CoreUI                               0x334a50fd -[CUINamedImage image] + 18
4   UIKit                                0x31b2ec01 -[_UIAssetManager imageNamed:scale:idiom:subtype:cachingOptions:] + 260
5   UIKit                                0x31b2eaf7 -[_UIAssetManager imageNamed:scale:idiom:subtype:] + 38
6   UIKit                                0x31b2eacd -[_UIAssetManager imageNamed:idiom:subtype:] + 44
7   UIKit                                0x31b2ea9b -[_UIAssetManager imageNamed:idiom:] + 46
8   UIKit                                0x31b75c45 +[UIImage imageNamed:inBundle:] + 56
9   SpriteKit                            0x319fde65 __26-[SKTexture loadImageData]_block_invoke + 1282
10  SpriteKit                            0x31a3798d SKSpinLockSync(int*, void ()() block_pointer) + 102
11  SpriteKit                            0x319fd8fd -[SKTexture loadImageData] + 300
12  SpriteKit                            0x31a007ef -[SKTexture size] + 42
13  SpriteKit                            0x31a21585 -[SKSpriteNode initWithTexture:] + 180
14  SpriteKit                            0x31a217e3 +[SKSpriteNode spriteNodeWithTexture:] + 146
15  White                                0x000c6037 -[EggsOnShelfScene useStrawToolOn:] (EggsOnShelfScene.m:546)
16  White                                0x000c4c9b -[EggsOnShelfScene useToolOnEgg:] (EggsOnShelfScene.m:400)
17  White                                0x000d0929 -[EggsOnShelfScene handleTapGesture:] (EggsOnShelfScene.m:1746)
18  UIKit                                0x31c99739 _UIGestureRecognizerSendActions + 194
19  UIKit                                0x31b4418b -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 1138
20  UIKit                                0x31ecfd4f ___UIGestureRecognizerUpdate_block_invoke + 44
21  UIKit                                0x31b0b5cf _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 216
22  UIKit                                0x31b09d33 _UIGestureRecognizerUpdate + 296
23  UIKit                                0x31b429fd -[UIWindow _sendGesturesForEvent:] + 772
24  UIKit                                0x31b423ab -[UIWindow sendEvent:] + 666
25  UIKit                                0x31b17d79 -[UIApplication sendEvent:] + 196
26  UIKit                                0x31b16569 _UIApplicationHandleEventQueue + 7114
27  CoreFoundation                       0x2f359f1f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 12
28  CoreFoundation                       0x2f3593e7 __CFRunLoopDoSources0 + 204
29  CoreFoundation                       0x2f357bd7 __CFRunLoopRun + 628
30  CoreFoundation                       0x2f2c2471 CFRunLoopRunSpecific + 524
31  CoreFoundation                       0x2f2c2253 CFRunLoopRunInMode + 106
32  GraphicsServices                     0x33fd02eb GSEventRunModal + 138
33  UIKit                                0x31b77845 UIApplicationMain + 1136
34  White                                0x000dcf27 main (main.m:8)
35  libdyld.dylib                        0x3a02eab7 start + 0
下面是我用来创建精灵的代码,当点击另一个精灵时,它会显示出来。同样,除了A7设备之外,这不会发生在任何设备上,iPhone上也不会发生。此外,这个相同的代码片段用于在其他精灵上执行完全相同的操作,并且不会在这些精灵上崩溃

if ([touchedSprite.name isEqualToString:@"Sad"]) {
    // Create the crop node
    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
        cropNode.position = CGPointMake(touchedSprite.position.x - 120, CGRectGetMinY(self.view.frame));
    } else
        cropNode.position = CGPointMake(touchedSprite.position.x - 120 * IPHONERATIO, CGRectGetMinY(self.view.frame) - 20);


    SKSpriteNode *sadSprite = [SKSpriteNode spriteNodeWithTexture:[SKTexture textureWithImageNamed:@"SadSprite"]];
    [sadSprite setName:@"sadSprite"];
    [cropNode addChild:sadSprite];

    sadSprite.position = CGPointMake(sadSprite.position.x, sadSprite.position.y + sadSprite.size.height / 2);

    SKSpriteNode *maskedImage = [SKSpriteNode spriteNodeWithTexture:[SKTexture textureWithImageNamed:@"SadSpriteMask"]];
    [cropNode setMaskNode:maskedImage];

    [self addChild:cropNode];

    NSArray *slurpSounds = @[@"sadSprite01.caf", @"sadSprite02.caf", @"sadSprite03.caf"];

    // Keep the sadSprite in the same position in relation to the egg
    [sadSprite runAction:[SKAction moveByX:0 y:-sadSprite.size.height duration:0.6]];

    // Move the sadSprite into position
    [cropNode runAction:[SKAction moveByX:0 y:sadSprite.size.height duration:0.6] completion:^{
        [cropNode runAction:[SKAction playSoundFileNamed:slurpSounds[self.toolSoundNumber] waitForCompletion:YES] completion:^{
            [sadSprite runAction:[SKAction moveByX:0 y:sadSprite.size.height duration:0.6] completion:^{
                [sadSprite removeFromParent];
            }];
            [cropNode runAction:[SKAction moveByX:0 y:-sadSprite.size.height duration:0.6] completion:^{
                [cropNode removeFromParent];
            }];
        }];
    }];
}

谢谢。

经过反复尝试,我找到了一个切片图像,其中顶部、底部、左侧或右侧切片的大小为0。我认为这是iOS上的一个bug。尝试在图像中添加更多的填充,这样切片就不会碰到边缘。

您是否已调试并逐步完成,以便确定它在哪一行崩溃?你能公布你得到的实际错误吗?另外,你能排除这是一个内存压力相关的崩溃吗?考虑到iPad视网膜图像对iPhone视网膜使用相同图像的4X内存,目前我无法访问任何A7设备。它在其他iPad和iPhone上运行良好,没有崩溃。明天将有一个测试,并将反馈我当时发现的。我有同样的问题。我在控制台上看到了这一点:
3月16:48:17 iPad迷你测试床[206]:CGImageProviderCreate:无效的图像提供程序大小:12 x 0。3月3日16:48:17 iPad迷你测试床[206]:CGImageCreate:无效图像大小:12 x 0。无法从csi位图数据创建图像
。不使用SpriteKit,只使用
imageNamed:
,并且仅在切片图像中出现。虽然这并不是我问题的确切答案,但它确实向我指出了问题所在,并且是正在加载的资产的大小不正确。感谢您也可以使用UIImage上的
[-resizebleimagewithcapinsets:
在代码中设置切片,这似乎适用于0个插图。感谢您发布解决方案。您好,我有类似的问题,但我不确定我是否了解解决方案。你能说得更具体些吗?谢谢