首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何创建单元格转到下一页

如何创建单元格转到下一页
EN

Stack Overflow用户
提问于 2013-04-15 20:10:51
回答 2查看 345关注 0票数 1

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

代码语言:javascript
复制
@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];
}

我想什么时候点击动物细胞阵列进入下一页(下一页是

也就是说,当我点击动物细胞数组时,我想刷新页面并显示点击单元的信息)

EN

回答 2

Stack Overflow用户

发布于 2013-04-15 20:16:24

尝尝这个

代码语言:javascript
复制
- (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];

}
票数 0
EN

Stack Overflow用户

发布于 2013-04-15 22:05:24

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16014825

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档