Search code examples
iphoneuisplitviewcontroller

NavigationBar hidden in detailViewController when presented modally


I am basically presenting my DetailViewController as modalView.In the modalView navigation bar is never visible, though I am not hiding it any where.Please help!


Solution

  • WriteReviewController *newReview = [[WriteReviewController alloc] initWithNibName:@"WriteReviewController" bundle:nil];
    
    UINavigationController *modalNavController = [[UINavigationController alloc] initWithRootViewController:newReview];
    
    // This is intended to be presented in another view controller class
    modalNavController.navigationBar.barStyle = UIBarStyleDefault;  
    [self.parentViewController presentModalViewController:modalNavController animated:YES]; 
    [modalNavController release];
    

    This code worked for me