开发者

Buttons not working in IOS5

开发者 https://www.devze.com 2023-04-13 03:35 出处:网络
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:

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 NSLogs in there somewhere and check if the methods are actually getting called... I would start around that..

0

精彩评论

暂无评论...
验证码 换一张
取 消