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