Hi everyone!
I have a doubt here!
In my View I have a UITableView, 4 sessions and 1 cell in each session, ok! For each cell I want to specify what view controller I want to go.
Example
in session 0 cell 0 - I want to go to DetailViewController
in session 1 cell 0 - I want to go to HelpViewController
How can I do it?
thanks!
__________________
Vai de Que? - Car supplies Util - Download
iJob - Job search (Br) - Download
iReembolso Lite - Refound control free - Download
iReembolso - Refound control - Download
Hi everyone!
I have a doubt here!
In my View I have a UITableView, 4 sessions and 1 cell in each session, ok! For each cell I want to specify what view controller I want to go.
Example
in session 0 cell 0 - I want to go to DetailViewController
in session 1 cell 0 - I want to go to HelpViewController
How can I do it?
thanks!
When you say "session," do you really mean section? Table views are in sections.
You need to implement the tableView:didSelectRowAtIndexPath: table view delegate method. In that method, use the indexPath parameter to figure out which cell the user tapped. Then you can push a new view controller (if you are using a navigation controller) or invoke a segue if not.
Since this sounds like a master/detail arrangement, it probably makes sense to put the view controller that contains your table view into a navigation controller, and move to your DetailViewController and HelpViewController with pushViewController:animated:. That way, you'll get a back button "for free", and will automatically return to the view controller with the table view when the user is done.
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.
When you say "session," do you really mean section? Table views are in sections.
You need to implement the tableView:didSelectRowAtIndexPath: table view delegate method. In that method, use the indexPath parameter to figure out which cell the user tapped. Then you can push a new view controller (if you are using a navigation controller) or invoke a segue if not.
Since this sounds like a master/detail arrangement, it probably makes sense to put the view controller that contains your table view into a navigation controller, and move to your DetailViewController and HelpViewController with pushViewController:animated:. That way, you'll get a back button "for free", and will automatically return to the view controller with the table view when the user is done.
Sorry! I write it wrong, I wanna said section.
Ok, so I have use the event tableView:didSelectRowAtIndexPath and depends the IndexPath I want, invoke the Segue, but how can I invoke a segue?
I did that so simple with navigation controller our without storyboard. lol
I was pushing the controller ABPeoplePickerNavigationController, and I was getting an error. Ok it works well when I push a "normal" controller, but how can I say that view (in storyboard) is the view of controller that I call?
thanks
__________________
Vai de Que? - Car supplies Util - Download
iJob - Job search (Br) - Download
iReembolso Lite - Refound control free - Download
iReembolso - Refound control - Download
Sorry! I write it wrong, I wanna said section.
Ok, so I have use the event tableView:didSelectRowAtIndexPath and depends the IndexPath I want, invoke the Segue, but how can I invoke a segue?
I did that so simple with navigation controller our without storyboard. lol
I was pushing the controller ABPeoplePickerNavigationController, and I was getting an error. Ok it works well when I push a "normal" controller, but how can I say that view (in storyboard) is the view of controller that I call?
thanks
For your application, I would suggest using a navigation controller, not segues. That way you can push a detail controller, the user can manipulate the content, then pop that view controller and go back to the table view.
You can save your navigation controller and all your other view controllers in your storyboard. Just use instantiateViewControllerWithIdentifier: when you want to create a new view controller, and use the resulting view controller in a call to the UINavigationController method pushViewController:animated:
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.