Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7931731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:48:36+00:00 2026-06-03T20:48:36+00:00

I use to show a viewcontroller from RootViewcontroller of a splitviewcontroller using the following

  • 0

I use to show a viewcontroller from RootViewcontroller of a splitviewcontroller using the following code. It will not shown any thing in iOS 5.1 portrait mode. when landscape it shows the controller inside the Rootviewcontroller. Its works fine upto iOS 5.0.

-(void)displayFileInReader:(NSURL *)fileURL    {

    SPDocumentReader *objiPadDocumentReader = [[SPDocumentReader alloc] init];
    objiPadDocumentReader.readerType = ReaderTypeLocalCachedDocument;
    objiPadDocumentReader.url = fileURL;
    UINavigationController *objNavigationController = [[UINavigationController alloc] initWithRootViewController:objiPadDocumentReader];
    objNavigationController.navigationBar.barStyle = UIBarStyleBlack;

    [self presentModalViewController:objNavigationController animated:YES];

    [objNavigationController release];
    objNavigationController = nil;

    [objiPadDocumentReader release];
    objiPadDocumentReader = nil;
}

I use self.splitviewcontroller and use detailviewcontroller instance instead of self.

But it this case when we click o detailview controller to dismiss/remove rootviewcontroller it cause crash saying something like “no window for the view”.

Also sometimes in iOS 5.1 the RootView shows in wrong orientation.

thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T20:48:37+00:00Added an answer on June 3, 2026 at 8:48 pm

    At last I found the solution,

    I think the issue may due to the split-view did not able to close the root-view controller when we try to present a view controller over it.
    I changed the above function like this

    -(void)displayFileInReader:(NSURL *)fileURL
    {
        SPDocumentReader *objiPadDocumentReader = [[SPDocumentReader alloc] init];
        objiPadDocumentReader.readerType = ReaderTypeLocalCachedDocument;
        objiPadDocumentReader.url = fileURL;
        UINavigationController *objNavigationController = [[UINavigationController alloc] initWithRootViewController:objiPadDocumentReader];
        objNavigationController.navigationBar.barStyle = UIBarStyleBlack;
    
        //to dismiss the splitview popover -to solve iOS5.1 splitview issue.
        [self.delegate dismissSplitViewPopOverController];
    
        [self presentModalViewController:objNavigationController animated:YES];
    
        [objNavigationController release];
        objNavigationController = nil;
    
        [objiPadDocumentReader release];
        objiPadDocumentReader = nil;
    }
    

    Here I pasted the split-view delegate that allow me to find the split-view popover.

    #pragma mark - UISplitView delegate
    
    // Called when rotating to a portrait orientation.
    - (void)splitViewController: (UISplitViewController*)svc
         willHideViewController:(UIViewController *)aViewController
              withBarButtonItem:(UIBarButtonItem*)barButtonItem
           forPopoverController: (UIPopoverController*)pc {
    
        barButtonItem.title = SPLocaleString(@"[Navigator]");
        self.navigationItem.leftBarButtonItem = barButtonItem;
    
        splitPopoverController = pc;
        [splitPopoverController retain];
    }
    
    // Called when the view is shown again in the split view, invalidating the button and popover controller.
    - (void)splitViewController: (UISplitViewController*)svc
         willShowViewController:(UIViewController *)aViewController
      invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem {
    
        self.navigationItem.leftBarButtonItem = nil;
    
        [splitPopoverController release];
        splitPopoverController = nil;
    }
    
    -(void)splitViewController:(UISplitViewController *)svc
             popoverController:(UIPopoverController *)pc
     willPresentViewController:(UIViewController *)aViewController
    {
        if (splitPopoverController)
        {
            [splitPopoverController release];
            splitPopoverController = nil;
        }
    
        splitPopoverController = pc;
        [splitPopoverController retain];
    }
    
    - (void)dismissSplitViewPopOverController {
        // If a popover controller is visible, hide it
        if (splitPopoverController) {
            [splitPopoverController dismissPopoverAnimated:NO];
            [splitPopoverController release];
            splitPopoverController = nil;
        } 
    }
    

    thank god,

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using this code to show a popover from the toolbar of the detail
I use below code to show folder list in AlertDialog: ListDialog = new AlertDialog.Builder(MyActivity.this);
I am using an UITableView to show some string messages, and I use NSOperationQueue
I want to use show a Loading Image on the click of server side
I'm trying to use the show and hide to display a different set of
I have created some functional categories that I use to show/hide markup elements. However,
I'm trying to use pyqt to show a custom QDialog window when a button
how can i use jQuery to show/hide the same div area... essentially swapping out
I am trying to use jQuery to show a div when the user selects
I am trying to use UIMenuCnotroller to show a list of dynamically generated items,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.