开发的应用程序在 Xcode 模拟器上运行良好,但是当我在真实设备上测试它时被终止。以下是应用程序终止时我的手机控制台打印的内容。
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);
}
有没有人有这方面的线索。真的……输了!
提前致谢