I have a navigation view, when I click, I just show the row number.
In the mainView:
-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
if (read == nil) {
readNotice *aController = [[readNotice alloc]initWithNibName:@"readNotice" bundle:nil];
self.read = aController;
}
[read updateRowNumber:indexPath.row];
[[self navigationController] pushViewController:read animated:YES];
and in my readNotice class:
-(void)updateRowNumber:(int)theindex {
rowNumber = theindex + 1;
message.text = [NSString stringWithFormat:@"row %i was clicked", rowNumber];
NSLog(@"view did load row = %d", rowNumber);
}
readNotice.xib only contents a Label.
First time I click it shows “Label”, but it works the following tries.
I suppose I need to initiliaze something that I missed, but I cant find it.
Thank you in advance
I m not able to understand why you made read variable …. ? use this ..
may this will help you…