I'm new in iOS programming, and I want to do a simple thing. I saw several topics about my problem, but I don't understand why my code doesn't work...
#import "details2ViewController.h"
In ViewController.m, I modified the didSelectRowAtIndexPath method like this :
details *det = [[details alloc] init];
[self.navigationController pushViewController:det animated:YES];
There is no warning, but no effect when I click on a cell... I precise that I'm working without mainStoryBoard.
note : Here's my previously post about this problem.
(Sorry if my english is awkward, I'm french... Thanks for your help !)
First of all check that you have properly wired your TableView's delegate to your ViewController's File Owner or not. TableView's -didSelectRowAtIndexPath
method is a delegate method.
Secondly, I am not getting why are using details
as a Class name when you already have imported details2ViewController.h
. So, It looks like you should use details2ViewController
instead details
and your code should look like this :
details2ViewController *det = [[details2ViewController alloc] initWithNibName:@"details2ViewController" bundle:nil];
[self.navigationController pushViewController:det animated:YES];
Make sure that your ViewController
is indeed embedded in a UINavigationController
. If not then your self.navigationController will
be nil
.
Or you can go through An Introduction To UINavigationController.