開發的應用程序在Xcode模擬器上運行良好,但是當我在真實設備上測試它時終止。以下是我的手機控制檯在應用程序終止時打印的內容。App在iPhone設備上意外終止,但在模擬器上正常工作
Nov 22 00:51:09 iPhone ReportCrash[3862] <Notice>: Formulating crash report for process CoL[3860]
��Nov 22 00:51:09 iPhone ReportCrash[3862] <Error>: libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary
��Nov 22 00:51:09 iPhone com.apple.launchd[1] (UIKitApplication:pan.ConquestOfLancaster[0xd857][3860]) <Warning>: (UIKitApplication:pan.ConquestOfLancaster[0xd857]) Job appears to have crashed: Segmentation fault: 11
��Nov 22 00:51:09 iPhone backboardd[52] <Warning>: Application 'UIKitApplication:pan.ConquestOfLancaster[0xd857]' exited abnormally with signal 11: Segmentation fault: 11
��Nov 22 00:51:09 iPhone ReportCrash[3862] <Notice>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/CoL_2012-11-22-005109_iPhone.plist using uid: 0 gid: 0, synthetic_euid: 501 egid: 0
��Nov 22 00:51:09 iPhone awdd[3863] <Error>: libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary
基本上,問題發生在我發射NSTimer(倒計數)並達到'1'時。凍結一段時間然後終止。
這裏是定時器初始化的方法:
- (void)MapMenu:(MapMenu *)menu didSelectButton:(NSInteger)index{
if (index == 0) {
if (self.owner == nil && distance < 10) {
CountDownTimer* countDown = [[CountDownTimer alloc]init];
[countDown startTimerOn:parentView];
[self performSelector:@selector(attackTo:attacker:) withObject:nil afterDelay:20.0];
}
else if (self.owner == @"Player_1")
NSLog(@"You have already occupy this building with name, %@", self.title);
}
}
- (void) attackTo: (BuildingViewController*) selectedBuilding attacker: (NSString*) attacker{
self.owner = @"Player_1";
NSLog(@"Building has a new owner with name, %@", self.owner);
}
有沒有人有這個線索。真的......迷路了!
在此先感謝
既然它說,「制定崩潰報告」,也許這將有所幫助。 –
對不起@PhillipMills,沒有明白你的意思。 :( – toto7
正在創建一個崩潰報告,你應該看看它。使用Xcode組織者和檢查設備上的崩潰報告。 – Kerni