Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ashwinr87

macrumors member
Original poster
Mar 9, 2011
81
0
Hi,

In my current Ipad app, I have a split screen view in which the detail view is a scroll view containing 4 table views. The functionality I was trying to achive was that when I click any row of the table in the scroll view, a screen is show containing additional information and I used presentModalViewController to try to get this functionality.

The problem I am having is that the view does show up when the table row is clicked, but it comes up behind my scroll view because I can see a part of the view at the sides of my scroll view...

This is what I did,
Code:
PopOverControllerContents *popContents = 
        [[PopOverControllerContents alloc] 
         initWithNibName:@"PopOverControllerContents" 
         bundle:[NSBundle mainBundle]];
[self presentModalViewController:popContents animated:YES];

Would anyone be able to tell me what I am doing wrong and How I can correct it?
 
self is the table view in which the row is clicked...
after doing some searching, I saw that the presentModalViewController would work properly if the view is got in as a subview of the rootview controller...

so does this mean that since my scrollview would be the root controller, I should get the modal view on the scrollview?
How would I do that?

What is self in your code snippet?
 
self is the tableview? Are you sure? That implies you have subclasses UITableView for some reason. Are you sure you don't mean it's the controller for that table view?
 
I think it is the tableview because I write this code inside the didSelectRowAtIndexPath function of one of the files ( which is a UIView controller subclass)...

self is the tableview? Are you sure? That implies you have subclasses UITableView for some reason. Are you sure you don't mean it's the controller for that table view?
 
I think it is the tableview because I write this code inside the didSelectRowAtIndexPath function of one of the files ( which is a UIView controller subclass)...

So it's the table views delegate, which is, as you point out the controller class. Not the table view at all.
 
What is the modalPresentationStyle?

From the documentation (which I expect you read, right?):

On iPhone and iPod touch devices, the view of modalViewController is always presented full screen. On iPad, the presentation depends on the value in the modalPresentationStyle property.
 
thank you very much... I was using only UIModalPresentationFullScreen because that was the only option coming on the auto complete.. I thought UIModalPresentationFormSheet was not available..
When is used UIModalPresentationFormSheet, it works...

One last question is whether I will be able to move the position of the popped up view, because I changed the orientation to landscape since my apps orientation is landscape... the view pops up correctly but its a bit out of position and I was wondering if there is any way to bring it to a position I need or atleast to a position in the middle of the screen

What is the modalPresentationStyle?

From the documentation (which I expect you read, right?):
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.