1
我有两个视图控制器,主要链接到导航控制器。我通过将主控制器连接到storybaord上的第二个控制器创建了一个segue。我称之为标识符“助理”,并将其推向了一个阶段。 我创建了表格视图单元格,并以编程方式将其附加到附件视图中(这是故意的)。该按钮调用performSegueWithIdentifier,但它不显示第二个视图控制器。除了我的iffy技术语言(只有IOS一个星期,对不起)任何想法我做错了什么?第二视图控制器不显示
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyIdentifier"];
//...
[myButton addTarget:self action:@selector(buttonizeButtonTap:) forControlEvents:UIControlEventTouchUpInside];
cell.accessoryView = myButton;
return cell;
}
-(void)buttonizeButtonTap:(id)sender{
[self performSegueWithIdentifier:@"Associate" sender:sender];
}
您是否验证过buttonizeButtonTap:方法被调用?你在看什么?第一个控制器是否会消失,但是您只是有一个空白的视图,或者当您触摸按钮时什么也没有发生? – rdelmar
不知道这是否实际存在于你的代码中,而是你说'@ selctor',而不是'@ selector'。并尝试将'sender:'更改为self。 – CaptJak
抱歉,输入的是相当复制的(不同的计算机)。该方法正在被调用。当我点击按钮时绝对没有任何反应。 – cartti