tags:

views:

34

answers:

1

hi all, i am usi9ng table view ,in the below method i want to set value of appdelegate.page equal to the value of table index.

if row one is selected than appdelgate.page = 1 if indexpath selectd =2, dan appdelegate.page =2...l;ike dat...so what should i replace index path in my code so that i will get the selected row index???

here my code

  • (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { appDelegate = [[UIApplication sharedApplication] delegate]; appDelegate.page = indexPath;//////what should i put here instead of indexpath

SecondViewController *svc = [[[SecondViewController alloc] init] autorelease]; svc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; [self presentModalViewController:svc animated:YES];

}

A: 

Create a Button in Cell of Table and set it's Tag with indexpath.row

Then Use -(IBAction)YourButton_TouchUpInside:(id)sender { }

Ashish Mathur
i am using images on tablew view..is ther any other way, i can get the index?
shishir.bobby