When I select the table row, nothing happens. It didn't go to ContentController and I can't find the UILabel
that I declared on ContentController.h when I want to link it to resultLabel
.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
ContentController *detailview = [[ContentController alloc] initWithNibName:@"ContentController" bundle:nil];
detailview.detailString = [NSString stringWithFormat:@"%d",indexPath.row];
[self.navigationController pushViewController:detailview animated:YES];
[detailview release];
}
ContentController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
resultLabel.text = self.detailString;
}
This may be because you don't have set your table view property to delegate & datasource by:
tableview.delegate=self;
tableview.datasource=self;
or set their property in xib is another option
Can be a state that in the method cellForRowAtIndexPath
:
cell = [self tableCellWithHeight:height clickable:NO withArrowAccessory:NO];
if clickable == NO
then didSelectRowAtIndexPath
method will never called for that cell.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With