1

我创建了一个 TableView 页面,这个 TableView 有很多来自这段代码的单元格:

@interface ViewController : UITableViewController
{
    NSMutableArray *animal;
    NSMutableArray *color;
    NSMutableArray *all;
}
@implementation ViewController

- (id)initWithStyle:(UITableViewStyle)style
{
    self = [super initWithStyle:style];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];

    animal = [[NSMutableArray alloc]initWithObjects:@"Lion",@"Tiger",@"Dog",@"Cat",@"Sheep",@"Wolf", nil];
    color = [[NSMutableArray alloc]initWithObjects:@"Blue",@"Red",@"Yellow",@"Green",@"Black", nil];

    all = [[NSMutableArray alloc]init];
    [all addObjectsFromArray:animal];
    [all addObjectsFromArray:color];
}

我想什么时候点击动物单元格数组转到下一页(下一页是
同一个根表视图,换句话说,我想要点击动物单元格数组表视图页面刷新并显示点击的单元格信息)

4

2 回答 2

0

请参考链接(它有从表中加载详细视图的示例), https://www.youtube.com/watch?v=0jt0vcrzq4A

于 2013-04-15T14:05:23.710 回答
0

尝试这个

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
 //if need any condition check here
 YourViewController *YVC = [[YourViewController alloc] initWithNibName:nil bundle:nil]]  
 [self.navigationController YourViewController:YVC animated:YES];

}
于 2013-04-15T12:16:24.373 回答