所以我一直在准备理解崩溃日志,我相信我的崩溃日志符号化了,但我仍然不明白。
Thread 0 Crashed:
0 libobjc.A.dylib 0x33c9a7f6 __sel_registerName
1 CoreFoundation 0x359934ea ___forwarding___
2 CoreFoundation 0x358eaf64 _CF_forwarding_prep_0 + 20
3 Texas42 0x0012e132 -[HelloWorldLayer closeBidPicker] + 750
4 Texas42 0x000e58f2 -[CCTimer update:] + 138
5 Texas42 0x000e77e4 -[CCScheduler tick:] + 464
6 Texas42 0x000f7e72 -[CCDirectorIOS drawScene] + 98
7 Texas42 0x000f8ff0 -[CCDirectorDisplayLink mainLoop:] + 16
8 QuartzCore 0x3360406c CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
9 QuartzCore 0x33603fc4 CA::Display::IOMFBDisplayLink::callback(__IOMobileFramebuffer*, unsigned long long, unsigned long long, unsigned long long, void*)
10 IOMobileFramebuffer 0x32dbefd4 IOMobileFramebufferVsyncNotifyFunc
11 IOKit 0x392a9446 IODispatchCalloutFromCFMessage
12 CoreFoundation 0x3595b5d8 __CFMachPortPerform
13 CoreFoundation 0x35966170 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__
14 CoreFoundation 0x35966112 __CFRunLoopDoSource1
15 CoreFoundation 0x35964f94 __CFRunLoopRun
16 CoreFoundation 0x358d7eb8 CFRunLoopRunSpecific
17 CoreFoundation 0x358d7d44 CFRunLoopRunInMode
18 GraphicsServices 0x35e142e6 GSEventRunModal
19 UIKit 0x36cb62fc UIApplicationMain
20 Texas42 0x000bba82 main + 70
21 Texas42 0x000bba34 start + 36
根据我的用户告诉我的情况,应用程序在调用“closebidpicker”方法时崩溃。这份崩溃报告到底在这条线上告诉我什么?我假设 750 指的是行偏移,但这种方法不是 750 行长。我彻底糊涂了。
我无法在手机或模拟器中重现此错误。如果我至少能查明它在哪条线上,那就太好了。
编辑:
我正在使用 ccTouchEnded 调用 closebidpicker:
- (void) ccTouchEnded:(UITouch *)touches withEvent:(UIEvent *)event
{
if (bidpicker.startPage==bidpicker.endPage && bidpicker.visible==YES && bidpicker.boo_pickermoved==NO && bidpicker.wasTouching==YES
&& bidpicker.isWindow==YES && bidpicker.wasWindow==YES)
{
[self schedule: @selector(closeBidPicker) interval:0.];
}
}
- (void) closeBidPicker
//(id)sender
{
NSLog(@"Entering CloseBidPicker");
[self unscheduleAllSelectors];
[self reorderChild:_label z:-1];
int int_currentbid;
bidpicker.bidpickeractive=false;
bidpicker.visible=NO;
bidPickerMenu.visible=NO;
[self reorderChild:bidPickerMenu z:0];
int int_pageindex;
if(currentbid<=41){int_pageindex=45-currentbid;}
if(currentbid>41){int_pageindex=1;}
int_currentbid=currentbid;
int int_currentpage;
int int_bid;
NSString *str;
if ((int_player_counter==3 && currentbid>29)||int_player_counter!=3)
{
int_currentbid=currentbid;
}
else
{
int_currentbid=currentbid+1;
}
int int_pagevalues[int_pageindex];
int_currentpage=[[bidpicker valueForKey:@"currentPage"]intValue];
if (30>int_currentbid) {int_pagevalues[30-int_currentbid]=30;}
if (31>int_currentbid) {int_pagevalues[31-int_currentbid]=31;}
if (32>int_currentbid) {int_pagevalues[32-int_currentbid]=32;}
if (33>int_currentbid) {int_pagevalues[33-int_currentbid]=33;}
if (34>int_currentbid) {int_pagevalues[34-int_currentbid]=34;}
if (35>int_currentbid) {int_pagevalues[35-int_currentbid]=35;}
if (36>int_currentbid) {int_pagevalues[36-int_currentbid]=36;}
if (37>int_currentbid) {int_pagevalues[37-int_currentbid]=37;}
if (38>int_currentbid) {int_pagevalues[38-int_currentbid]=38;}
if (39>int_currentbid) {int_pagevalues[39-int_currentbid]=39;}
if (40>int_currentbid) {int_pagevalues[40-int_currentbid]=40;}
if (41>int_currentbid) {int_pagevalues[41-int_currentbid]=41;}
if (42>int_currentbid) {int_pagevalues[42-int_currentbid]=42;}
if (42>int_currentbid) {int_pagevalues[43-int_currentbid]=84;}
else if (42*2>int_currentbid) {int_pagevalues[1]=42*2;}
else if (42*3>int_currentbid) {int_pagevalues[1]=42*3;}
else if (42*4>int_currentbid) {int_pagevalues[1]=42*4;}
else if (42*5>int_currentbid) {int_pagevalues[1]=42*5;}
if (currentbid<42)
{
if ((int_player_counter==3 && currentbid>29)||int_player_counter!=3)
{
int_pagevalues[0]=0;
}
else
{
int_pagevalues[0]=30;
}
int_bid=int_pagevalues[int_currentpage];
}
else
{
int_bid=int_currentpage*(int_currentbid+42);
}
if (int_bid<42 && int_bid>0)
{
int_currenthighbidder=1;
str = [NSString stringWithFormat:@"%d!",int_bid];
[_player1actionlabel setString:str];
}
else if (int_bid==42){
int_currenthighbidder=1;
str = [NSString stringWithFormat:@"1 Mark!"];
[_player1actionlabel setString:str];
}
else if (int_bid==42*2){
int_currenthighbidder=1;
str = [NSString stringWithFormat:@"2 Marks!"];
[_player1actionlabel setString:str];
}
else if (int_bid==42*3){
int_currenthighbidder=1;
str = [NSString stringWithFormat:@"3 Marks!"];
NSLog(@"CloseBidPicker-14542");
[_player1actionlabel setString:str];
}
else if (int_bid==42*4){
int_currenthighbidder=1;
str = [NSString stringWithFormat:@"4 Marks!"];
[_player1actionlabel setString:str];
}
else if (int_bid==42*5){
int_currenthighbidder=1;
str = [NSString stringWithFormat:@"5 Marks!"];
[_player1actionlabel setString:str];
}
else if (int_bid==0)
{
str = @"Passes!";
[_player1actionlabel setString:str];
}
if (int_bid>currentbid)
{
int_player1bid=int_bid;
currentbid=int_player1bid;
}
//Code is failing when I call reorderChild, but only when computer bid 42 or more.
[self reorderChild:_player1actionlabel z:1];
[self reorderChild:_player1actionlabelbackground z:0];
int_player_counter=int_player_counter+1;
if (int_array_currentmove_player[int_player_counter]==2)
[self schedule: @selector(player2Bid) interval:1.5];
if (int_array_currentmove_player[int_player_counter]==3)
[self schedule: @selector(player3Bid) interval:1.5];
if (int_array_currentmove_player[int_player_counter]==4)
[self schedule: @selector(player4Bid) interval:1.5];
if (int_player_counter==4)
{
int_player_counter=0;
[self schedule: @selector(determineBidWinner) interval:1];
}
}
实际方法确实没有什么特别之处,我看不出它会在 iOS 6 而不是 5 中崩溃的任何原因。
我不明白的是这个...
如果我直接为我的设备构建它,它在我的设备上运行良好,但如果我通过 iTunes 安装 beta 版本,它会崩溃。
我能够找到导致我出现问题的代码。当我注释掉
[self reorderChild:_player1actionlabel z:2];
[self reorderChild:_player1actionlabelbackground z:1];
它工作正常。我完全不知道它为什么这样做。