PDA

View Full Version : Rows in master view dont respond to clicks..




akaash1087
Aug 14, 2012, 03:00 AM
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..



dejo
Aug 14, 2012, 08:48 AM
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..

What is your understanding of what modal views are and how they work?

akaash1087
Aug 16, 2012, 01:12 AM
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
Aug 16, 2012, 03:57 AM
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
Aug 16, 2012, 06:56 AM
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
Aug 16, 2012, 09:10 AM
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..