presentmodalviewcontroller not working properly in Application Delegate in iPhone

Posted by sujyanarayan on Stack Overflow See other posts from Stack Overflow or by sujyanarayan
Published on 2010-05-12T12:11:59Z Indexed on 2010/05/12 12:14 UTC
Read the original article Hit count: 161

Hi, I'm using two UIViewController in Application Delegate and navigating to UIViewController using presentmodalviewcontroller. But Problem is that presentmodalviewcontroller works for first time UIViewController and when i want to navigate to second UIViewController using presentmodalviewcontroller then its showing first UIViewController. The following is the code:-

-(void)removeTabBar:(NSString *)str { HelpViewController *hvc =[[HelpViewController alloc] initWithNibName:@"HelpViewController" bundle:[NSBundle mainBundle]]; VideoPlaylistViewController *vpvc =[[VideoPlaylistViewController alloc] initWithNibName:@"VideoPlaylistViewController" bundle:[NSBundle mainBundle]]; if ([str isEqualToString:@"Help"]) { [tabBarController.view removeFromSuperview]; [vpvc dismissModalViewControllerAnimated:YES]; [viewController presentModalViewController:hvc animated:YES]; [hvc release]; } if ([str isEqualToString:@"VideoPlaylist"]) { [hvc dismissModalViewControllerAnimated:YES]; [viewController presentModalViewController:vpvc animated:YES]; [vpvc release]; } }

Can Somebody help me in solving the problem?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c