缺乏对碰撞报告的理解
我有这个崩溃报告。
Incident Identifier: CA9E350A-C842-4349-AAD8-E9E62E93BDD1 CrashReporter Key: 360bc129d2f79a48e291eb5ca38b24e822ed5b6b Hardware Model: xxx Process: OrientalDailyiOS [1502] Path: /var/mobile/Applications/39480A57-68FF-4C46-8445-340EFE204119/OrientalDailyiOS.app/OrientalDailyiOS Identifier: OrientalDailyiOS Version: ??? (???) Code Type: ARM (Native) Parent Process: launchd [1] Date/Time: 2012-10-14 15:49:10.884 -0700 OS Version: iOS 6.0 (10A403) Report Version: 104 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Crashed Thread: 0 Last Exception Backtrace: 0 CoreFoundation 0x37a0a29e __exceptionPreprocess + 158 1 libobjc.A.dylib 0x34e3197a objc_exception_throw + 26 2 CoreFoundation 0x37955b70 -[__NSArrayM objectAtIndex:] + 160 3 OrientalDailyiOS 0x00064fdc -[Main_NewsDetail viewDidLoad] (Main_NewsDetail.m:43) 4 UIKit 0x386cb590 -[UIViewController loadViewIfRequired] + 360 5 UIKit 0x38757336 -[UIViewController shouldAutorotate] + 22 6 UIKit 0x38798cd4 -[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:] + 1540 7 UIKit 0x38797fca -[UIViewController presentViewController:withTransition:completion:] + 3390 8 UIKit 0x388ba252 -[UIViewController presentModalViewController:animated:] + 26 9 Foundation 0x34364a6a __NSFireDelayedPerform + 446 10 CoreFoundation 0x379df5da __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 10 11 CoreFoundation 0x379df28c __CFRunLoopDoTimer + 268 12 CoreFoundation 0x379ddefc __CFRunLoopRun + 1228 13 CoreFoundation 0x37950eb8 0x37948000 + 36536 14 CoreFoundation 0x37950d44 CFRunLoopRunInMode + 100 15 GraphicsServices 0x373e32e6 GSEventRunModal + 70 16 UIKit 0x387002fc 0x386a9000 + 357116 17 OrientalDailyiOS 0x0005fac2 main (main.m:16) 18 OrientalDailyiOS 0x0005fa84 0x5e000 + 6788
然而,我不知道错误在哪里,我玩我的应用程序,但没有显示错误。
我也用iPad试过iOS 6,没问题。
苹果的反馈是什么
We found that your app crashed on iPad running iOS 6, which is not in compliance with the App Store Review Guidelines. Your app crashed on both Wi-Fi and cellular networks when we: 1. Launch the app. 2. Tap any item on main page. 3. App crashes.
更新
Main_NewDetails - (void)viewDidLoad { [super viewDidLoad]; [slider setHidden:YES]; DatabaseAction *getnews = [[[DatabaseAction alloc] init] autorelease]; self.singlenews = [getnews retrieveSingleNews:newsid]; self.defaultsize = [getnews retrieveFont]; font = [self.defaultsize objectAtIndex:0]; currentsize = font.Font_Size; News *new = [self.singlenews objectAtIndex:0]; if(self.catsid != 10) self.header.text = new.News_Cat_Name; else self.header.text = @"評論"; self.title.text = new.News_Title; authortext = new.News_Author; self.content.text = [NSString stringWithFormat: @"%@%@", new.News_IntroText, new.News_FullText]; self.introtext = new.News_IntroText; self.content.font = [UIFont systemFontOfSize:currentsize]; self.date.text = new.News_ArticalDate; self.commentno.text = @"留言: 0"; imagepath = new.News_ImagePath; onetime = YES; if([Constant_Config NetworkStatus]){ if(![imagepath isEqualToString:@"no picture"]){ NSOperationQueue *queue = [NSOperationQueue new]; NSInvocationOperation *operation = [[NSInvocationOperation alloc] initWithTarget:self selector:@selector(loadImage) object:nil]; [queue addOperation:operation]; [operation release]; } NetworkHandler *networkHandler=[[NetworkHandler alloc] init]; GetTotalCommentsRequest *gettotalcomments= [[GetTotalCommentsRequest alloc] init:newsid]; [networkHandler setDelegate:self]; [networkHandler request:gettotalcomments]; [gettotalcomments release]; [networkHandler release]; [self.scrollView addSubview:[self addbanner]]; [self.scrollView addSubview:[self addbanner]]; } [self setlabelXY]; AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate]; [appDelegate openSessionWithAllowLoginUI:NO]; }
你正在看的是一个堆栈跟踪,程序通过你的代码的path。 每行是一个函数,从主运行循环(18)开始,到崩溃(0)结束。
最有用的部分是您在第3帧的应用程序OrientalDailyiOS
中创build的function。
您的应用程序崩溃尝试访问Main_NewsDetail viewDidLoad]
方法(第3帧)内的NSArray(第2帧)中的对象。
编辑
正如我所说,你的应用程序崩溃尝试访问一个NSArray中的对象。 仔细看看你的应用程序,特别是你的viewDidLoad
方法中的两行,这个方法使用了在objectAtIndex:
之上崩溃的方法。
font = [self.defaultsize objectAtIndex:0]; News *new = [self.singlenews objectAtIndex:0];
你如何填充self.singlenews
? 如果没有物体,情况如何呢?