UITableViewCell select even doesn't work
- by saimun
I had a page control(UIPageControl) on a view (UIViewController) with table view (UITableView) on each page, each page have own table and can go to different view controller. i add the codes in "didSelectRowAtIndexPath" which can go to next level, is works perfect when i test it in a table view by itself, but it doesn't works when i have page controller with it.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (pageNumber == 0) {
PicturesViewController *picturesView = [[PicturesViewController alloc] init];
[self.navigationController pushViewController:picturesView animated:YES];
[picturesView release];
} else if (pageNumber == 1) {
PictureDetailViewController *pictureDetailView = [[PictureDetailViewController alloc] init];
[self.navigationController pushViewController:pictureDetailView animated:YES];
[pictureDetailView release];
} else if (pageNumber == 2) {
MessagesViewController *messagesView = [[MessagesViewController alloc] init];
[self.navigationController pushViewController:messagesView animated:YES];
[messagesView release];
}
}
here is the code, if view directly to this table view this code is work,
how can i make it work under the pagecontrol??