UITableViewCell select even doesn't work

Posted by saimun on Stack Overflow See other posts from Stack Overflow or by saimun
Published on 2010-05-19T08:06:24Z Indexed on 2010/05/19 8:10 UTC
Read the original article Hit count: 193

Filed under:
|

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??

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c