Hey :) So I've been programming an app that I want to have available on the 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). The app works perfectly fine on my phone and on my mom's iPad, along with all the simulators. 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:
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.
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
. 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).