views:

183

answers:

1

Hi,

Here is a complex question, maybe it's not hard but there are many doubts i have. First let me give you what i have. This is the only place where i've gotten good answers.

I have a table view controller with custom cells. In those cells i added a button (info dark one from IB) for each one of the cells. What i would like it's that when I press that button it displays a new view with more information about that cell, different of the view that i get from didSelectRowAtIndexPath.

I've read a little bit about Modal View Controller and I think this is a case where I should use it. So here are my questions:

  1. How do i make a view controller a modal view controller?. I read that i have to have a delegate. Is there an example of how to create a normal modal view controller. I haven't been able to do so.

  2. How can this button know which cell is it from?. What i have right is a subclass tableviewcell with an IBOUTLET to this info button. This is not an important question because i guess i just could add a NSIndexPath attribute.

  3. I added an action in my tableviewsubclass that is triggered when the touchDown Event is called. I did this connection through IB. How can I call the modal view controller through here?, and is it even the right place to do this?

Thanks

A: 

How about you just push a "detail view" onto your navigation controller stack? The mechanics are the same for modal view controllers as they are for others. you just need to remember to use the [self presentModalViewController:arrayViewController animated:YES]; when pushing your detail view.

apski