i built an app on ios 4.3 and it worked fine but when i run it on the new ios the back buttons dont work. Heres my code to go to the next xib:
-(IBAction)Selection3Page:(id)sender;{
//show next view
Selection3Page * nvc = [[Selection3Page alloc] initWithNibName:n开发者_运维百科il bundle:nil];
[self presentModalViewController:nvc animated:NO];
[nvc release];
}
and this is the code to return back to the first xib:
-(IBAction)done:(id)sender{
[self.parentViewController dismissModalViewControllerAnimated:NO];
}
please help!!
The API for dismissing modal views was changed somewhat in iOS 5. Try this instead:
if ([self respondsToSelector:@selector(dismissViewControllerAnimated:completion:)])
{
NSLog(@"didTouchDoneButton 5.x");
[self dismissViewControllerAnimated:YES completion:nil];
}
else
{
NSLog(@"didTouchDoneButton 4.x");
[self dismissModalViewControllerAnimated:YES];
}
post some NSLog
s in there somewhere and check if the methods are actually getting called... I would start around that..
精彩评论