我创建了一个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];
}我想什么时候点击动物细胞阵列进入下一页(下一页是
也就是说,当我点击动物细胞数组时,我想刷新页面并显示点击单元的信息)
发布于 2013-04-15 20:16:24
尝尝这个
- (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-15 22:05:24
请参考链接(其中包含从表中加载详细视图的示例),https://www.youtube.com/watch?v=0jt0vcrzq4A
https://stackoverflow.com/questions/16014825
复制相似问题