iOS 3.X SIGABRT设置modalPresentationStyle在4.2 iPod Touch上运行良好

iOS 3.X SIGABRT设置modalPresentationStyle在4.2 iPod Touch上运行良好,ios,iphone-sdk-3.0,ios4,Ios,Iphone Sdk 3.0,Ios4,设置iPod Touch 2G(3.1.3)上的演示样式与SIGBART崩溃,但在iPod Touch 4G(4.2)上工作正常。这是虫子吗?有人能给我一个解决办法吗 DateDialogController* dlg = [[DateDialogController alloc] initWithNibName:@"DateDialogView" bundle:nil]; [dlg setDelegate:self]; dlg.startDate = self.anchorDate; self

设置iPod Touch 2G(3.1.3)上的演示样式与SIGBART崩溃,但在iPod Touch 4G(4.2)上工作正常。这是虫子吗?有人能给我一个解决办法吗

DateDialogController* dlg = [[DateDialogController alloc] initWithNibName:@"DateDialogView" bundle:nil];
[dlg setDelegate:self];
dlg.startDate = self.anchorDate;
self.navigationController.modalPresentationStyle = UIModalPresentationCurrentContext;
[self.navigationController presentModalViewController:dlg animated:YES];
[dlg release];


2011-08-02 13:44:20.785 Mobile Manager[274:207] *** -[UINavigationController setModalPresentationStyle:]: unrecognized selector sent to instance 0x230000
2011-08-02 13:44:20.789 Mobile Manager[274:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UINavigationController setModalPresentationStyle:]: unrecognized selector sent to instance 0x230000'
2011-08-02 13:44:20.799 Mobile Manager[274:207] Stack: (
    864992541,
    859229716,
    864996349,
    864492313,
    864454720,
    346779,
    864749711,
    839231364,
    839231212,
    839231156,
    839230220,
    839233420,
    839227648,
    839225236,
    839206800,
    839205012,
    875886564,
    864740651,
    864738335,
    875880904,
    838872112,
    838865456,
    54257,
    54172
)
terminate called after throwing an instance of 'NSException'
Program received signal:  “SIGABRT”.

您正在设置的属性
modalPresentationStyle
仅在iOS3.2+上可用,因为您的iPod正在运行3.1.2,它无法响应设置该属性的方法

在房间里

至于解决这个问题,像这样的代码通常会有所帮助

 DateDialogController* dlg = [[DateDialogController alloc] initWithNibName:@"DateDialogView" bundle:nil];
[dlg setDelegate:self];
dlg.startDate = self.anchorDate;

// Set the property if the iOS version allows it
NSString *currSysVer = [[UIDevice currentDevice] systemVersion];    
if ([currSysVer compare:@"3.2" options:NSNumericSearch] != NSOrderedAscending) {
    self.navigationController.modalPresentationStyle = UIModalPresentationCurrentContext;
}

[self.navigationController presentModalViewController:dlg animated:YES];
[dlg release];
NSString *currSysVer = [[UIDevice currentDevice] systemVersion];    
if ([currSysVer compare:@"3.2" options:NSNumericSearch] != NSOrderedAscending) {

在旧版iPod Touch上的旧版iOS中,这种风格可能不同/不推荐吗?