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

akaash1087

macrumors newbie
Original poster
Jul 7, 2010
23
0
I am working on a splitview based app.In one of my detail VCs I am presenting a VC modally.My master VC consists of several rows.On each row click a different view appears in the detail view.When I present a VC modally
from within one of my DetailViewcontrollers ,the rows in my master view dont respond to clicks.
Is there any reason behind it..

I have tried to use loadView method but it rotates the screen.How do I prevent that from happening??.
Any help would be highly appreciated..
 

akaash1087

macrumors newbie
Original poster
Jul 7, 2010
23
0
Modall VCs are used to present a Vc from within another VC..

Modal views are basically used when you want to present a VC's content from within another VC.It could be needed when you want to present a screen on a btn click,in that case you would write the action for that btn,within which you use PresentModalViewController() method.
This is what I am doing..
In my splitview app there are master panes and detailVCs,with different Views coming up on different row clicks.In one of the views I present a VC modally on a btn click,it gets presented ..but after that when I click on different rows of
my master view ,different Views dont appear..as they did earlier..
 

akaash1087

macrumors newbie
Original poster
Jul 7, 2010
23
0
loadView rotates the screen??..

I also called loadView method on splitviewcontroller.I called it in the didSelectRowAtIndexPath: method of the source file which corresponds to the master view(consisting of a number of rows) where I am checking which row the user has clicked and then doing the appropriate thing.In that I call loadView method on the splitviewcontroller .The screen corresponding to that row comes up (it was not coming up earlier) but it is rotated.I dont know what causes the screen to rotate.
What can I do to prevent the screen to rotate?
 

Duncan C

macrumors 6502a
Jan 21, 2008
853
0
Northern Virginia
Modal views are basically used when you want to present a VC's content from within another VC.It could be needed when you want to present a screen on a btn click,in that case you would write the action for that btn,within which you use PresentModalViewController() method.
This is what I am doing..
In my splitview app there are master panes and detailVCs,with different Views coming up on different row clicks.In one of the views I present a VC modally on a btn click,it gets presented ..but after that when I click on different rows of
my master view ,different Views dont appear..as they did earlier..

A modal VC locks the screen so you can't do anything else until you finish with it. It puts the device into a "mode". That's the way it is supposed to work. If you don't want that to happen, add a subview to your VC rather than presenting a modal VC

----------

I also called loadView method on splitviewcontroller.I called it in the didSelectRowAtIndexPath: method of the source file which corresponds to the master view(consisting of a number of rows) where I am checking which row the user has clicked and then doing the appropriate thing.In that I call loadView method on the splitviewcontroller .The screen corresponding to that row comes up (it was not coming up earlier) but it is rotated.I dont know what causes the screen to rotate.
What can I do to prevent the screen to rotate?


If you read the docs on loadView:


loadView
Creates the view that the controller manages.

- (void)loadView
Discussion
You should never call this method directly. The view controller calls this method when its view property is requested but is currently nil. This method loads or creates a view and assigns it to the view property.

When you ignore warnings like that, the results are undefined.
 

akaash1087

macrumors newbie
Original poster
Jul 7, 2010
23
0
Got it..I had read that..but I ignored it..because I was not getting any output..
I will take care in future..

Thanks a lot..
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.