I’m new in Objective-C and I’m start to work on app that will have a few View’s. I want to create them 100% programmatically without XIB files. I understand that I have to create my ViewControllers classes for my screens, but I want to ask you how to manage a navigation with it. Let’s say that I have one ViewController which contains a tableView. And i want to create a next screen. So I understand that row in tableViewController class calling
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { //... }
But what about next screen? I don’t have it yet. Should I create a “ready” ViewController class? How to handle a navigation in this case?
In your case, when a cell is selected, you would:
So, first, you need to ensure that your first view controller (the one with the table view) is contained in an UINavigationController.
Then, when a cell in your table view is selected, you can write: