简体   繁体   English

iOS App Store评论崩溃

[英]iOS App Store Review Crash

Hey :) So I've been programming an app that I want to have available on the App Store. 嘿:)因此,我一直在编写一个我想在App Store上可用的应用程序。 However, I have already submitted it twice with rejections concerning a crash when the app is played on an iPad (running 7.0.6 and 7.1, for both submits). 但是,我已经提交了两次,但都拒绝在iPad上播放该应用程序时崩溃(两次提交都运行7.0.6和7.1)。 The app works perfectly fine on my phone and on my mom's iPad, along with all the simulators. 该应用程序在我的手机和妈妈的iPad上以及所有模拟器上都可以正常运行。 I also looked at the crash log (relevant info posted here): 我还查看了崩溃日志(此处发布了相关信息):

Date/Time:           2014-03-15 14:29:04.504 -0700
OS Version:          iOS 7.1 (11D167)
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread:  0

Last Exception Backtrace:
0   CoreFoundation                  0x182fb6950 __exceptionPreprocess + 132
1   libobjc.A.dylib                 0x18f9901fc objc_exception_throw + 60
2   CoreFoundation                  0x182ec0c7c -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 396
3   CoreFoundation                  0x182ec0ac4 +[NSDictionary dictionaryWithObjects:forKeys:count:] + 72
4   Water Balloon                   0x1000b0be4 -[WBLogic updateScoreboard:] (WBLogic.m:406)
5   Water Balloon                   0x1000b0598 -[WBLogic checkCollision:] (WBLogic.m:341)
6   Water Balloon                   0x1000aff10 -[WBLogic update] (WBLogic.m:231)
7   SpriteKit                       0x185e47fb0 -[SKView(Private) _update:] + 236
8   SpriteKit                       0x185e45ab0 -[SKView renderCallback:] + 876
9   SpriteKit                       0x185e43794 __29-[SKView setUpRenderCallback]_block_invoke + 76
10  SpriteKit                       0x185e62a90 -[SKDisplayLink _callbackForNextFrame:] + 288
11  QuartzCore                      0x185bbccbc CA::Display::DisplayLinkItem::dispatch() + 36
12  QuartzCore                      0x185bbcac8 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 300
13  IOKit                           0x183eb7e74 IODispatchCalloutFromCFMessage + 364
14  CoreFoundation                  0x182f682e0 __CFMachPortPerform + 192
15  CoreFoundation                  0x182f76890 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
16  CoreFoundation                  0x182f767f0 __CFRunLoopDoSource1 + 444
17  CoreFoundation                  0x182f74a14 __CFRunLoopRun + 1620
18  CoreFoundation                  0x182eb56d0 CFRunLoopRunSpecific + 452
19  GraphicsServices                0x188b51c0c GSEventRunModal + 168
20  UIKit                           0x185fe6fdc UIApplicationMain + 1156
21  Water Balloon                   0x1000b1c38 main (main.m:16)
22  libdyld.dylib                   0x18ff83aa0 start + 4


Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib          0x000000019007e58c __pthread_kill + 8
1   libsystem_c.dylib               0x0000000190012804 abort + 108
2   libc++abi.dylib                 0x000000018f238990 abort_message + 84
3   libc++abi.dylib                 0x000000018f255c28 default_terminate_handler() + 296
4   libobjc.A.dylib                 0x000000018f9904d0 _objc_terminate() + 124
5   libc++abi.dylib                 0x000000018f253164 std::__terminate(void (*)()) + 12
6   libc++abi.dylib                 0x000000018f252a7c __cxa_throw + 132
7   libobjc.A.dylib                 0x000000018f990314 objc_exception_throw + 340
8   QuartzCore                      0x0000000185bbcd7c CA::Display::DisplayLinkItem::dispatch() + 228
9   QuartzCore                      0x0000000185bbcac4 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 296
10  IOKit                           0x0000000183eb7e70 IODispatchCalloutFromCFMessage + 360
11  CoreFoundation                  0x0000000182f682dc __CFMachPortPerform + 188
12  CoreFoundation                  0x0000000182f7688c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
13  CoreFoundation                  0x0000000182f767ec __CFRunLoopDoSource1 + 440
14  CoreFoundation                  0x0000000182f74a10 __CFRunLoopRun + 1616
15  CoreFoundation                  0x0000000182eb56cc CFRunLoopRunSpecific + 448
16  GraphicsServices                0x0000000188b51c08 GSEventRunModal + 164
17  UIKit                           0x0000000185fe6fd8 UIApplicationMain + 1152
18  Water Balloon                   0x00000001000b1c34 main (main.m:16)
19  libdyld.dylib                   0x000000018ff83a9c start + 0

Usually a crash log would be useful in pointing out where the crash occurred, which would lead to why the crash occurred, but line 406 only points to this line in the code: 通常,崩溃日志对于指出崩溃发生的位置很有用,这将导致崩溃发生的原因,但是第406行仅指向代码中的该行:

scorelabel.position = CGPointMake(width/2, height/2 + 150);

the entire method that this line is in is this: 该行所在的整个方法是这样的:

- (void) updateScoreboard:(BOOL) on
{
    if(on)
    {
        int w = scoreboard.size.width;
        int h = scoreboard.size.height;

        if(score > highScore)
        {
            highScore = score;
            [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithInt:highScore] forKey:@"HighScore"];
        }
        [highScorelabel setText:[NSString stringWithFormat:@"High Score: %i", highScore]];

        CGSize defs;
        CGSize ss;
        CGSize hs;

        defs = [@"Score: 1" sizeWithAttributes:@{NSFontAttributeName: [UIFont fontWithName:@"04b_19" size:scorelabel.fontSize]}];
        ss = [[scorelabel text] sizeWithAttributes:@{NSFontAttributeName:[UIFont fontWithName:@"04b_19" size:scorelabel.fontSize]}];
        hs = [[highScorelabel text] sizeWithAttributes:@{NSFontAttributeName:[UIFont fontWithName:@"04b_19" size:highScorelabel.fontSize]}];

        scorelabel.position = CGPointMake(width/2 - w/4 - defs.width/2 + ss.width/2, scoreboard.position.y + h/4);
        highScorelabel.position = CGPointMake((scorelabel.position.x - ss.width/2) + hs.width/2, scorelabel.position.y - ss.height/2 - hs.height/2);
    }
    else
    {
        scorelabel.position = CGPointMake(width/2, height/2 + 150);
    }
    [scoreboard setHidden:!on];
    [taplabel setHidden:!on];
    [highScorelabel setHidden:!on];
}

I have no idea what the problem could be... Please help me find out why the app is causing their iPads to crash. 我不知道可能是什么问题...请帮助我找出为什么该应用导致其iPad崩溃的原因。

EDIT In response to the comment, height and width are determined like this: 编辑根据评论,高度和宽度的确定如下:

width = scene.frame.size.width;
height = scene.frame.size.height;

Which is in - (id) init: (SKScene *) s . 这是- (id) init: (SKScene *) s Also, I just found out that the entire time my app had been running with the logic scene inheriting from NSObject, not SKScene... Could that have had an influence (the app runs the same when I test it). 此外,我刚刚发现我的应用程序在整个运行过程中都是从NSObject继承逻辑场景,而不是从SKScene继承...可能会产生影响(在我测试应用程序时,该应用程序运行相同)。

It is likely that the actual line of code in the symbolicated report is off by some lines. 带符号的报告中的实际代码行可能会偏离某些行。 Since above the reported lines you actually do create dictionaries, and the crash is caused by an exception when creating a dictionary, it is likely that the crash happened. 由于实际上在报告的行上方确实创建了字典,并且崩溃是由创建字典时的异常引起的,因此崩溃很可能发生了。 there. 那里。

So the lines in question are: 因此,有问题的行是:

defs = [@"Score: 1" sizeWithAttributes:@{NSFontAttributeName: [UIFont fontWithName:@"04b_19" size:scorelabel.fontSize]}];
ss = [[scorelabel text] sizeWithAttributes:@{NSFontAttributeName:[UIFont fontWithName:@"04b_19" size:scorelabel.fontSize]}];
hs = [[highScorelabel text] sizeWithAttributes:@{NSFontAttributeName:[UIFont fontWithName:@"04b_19" size:highScorelabel.fontSize]}];

And the dictionary is always the same: 而且字典总是一样的:

@{NSFontAttributeName:[UIFont fontWithName:@"04b_19" size:highScorelabel.fontSize]}

So as a first step you should create a local variable for that dictionary and re-use that. 因此,第一步,您应该为该字典创建一个局部变量,然后重新使用该局部变量。

Now the crash is caused when creating the dictionary, since the exception message is missing in the crash report we have to guess here. 现在,崩溃是在创建字典时引起的,因为崩溃报告中缺少异常消息,我们不得不在这里猜测。 One option is that you are trying to set a key to a nil value. 一种选择是您尝试将键设置为nil值。 So when can [UIFont fontWithName:@"04b_19" size:highScorelabel.fontSize] be nil? 那么什么时候[UIFont fontWithName:@"04b_19" size:highScorelabel.fontSize]可以为零?

The documentation doesn't really say, but I'd assume this can happen if the font with a given name cannot be found. 文档并没有真正说出,但是我认为如果找不到具有给定名称的字体,则可能会发生这种情况。 So you should check if the font is really part of the app bundle you submitted to Apple. 因此,您应该检查字体是否确实是您提交给Apple的应用程序捆绑包的一部分。 Then check if the fontName property is set to the correct value that also works on a device. 然后检查fontName属性是否设置为也可以在设备上使用的正确值。 The documentation says: 该文件说:

The fully specified name of the font. 字体的完整指定名称。 This name incorporates both the font family name and the specific style information for the font 该名称包含字体系列名称和字体的特定样式信息

This thread may provide an idea what can go wrong in that case: Crash with exception attempt to insert nil object from objects[0] 该线程可以提供一个想法,在这种情况下可能会出错: 崩溃并尝试从对象中插入nil对象[0]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM