简体   繁体   English

第二个视图控制器未显示

[英]Second view controller not showing

I have two view controllers, the main linked to a navigation controller. 我有两个视图控制器,主要链接到导航控制器。 I created a segue by linking the main controller to the second on the storybaord. 我通过将主控制器链接到Storybaord上的第二个控制器来创建segue。 I've called the Identifier "Associate" and made it a push segue. 我将标识符称为“关联”,并将其作为推送序列。 I create table view cells with a button attached to the accessory view programatically (this is deliberate). 我以编程方式创建了带有附属于附件视图的按钮的表格视图单元(这是有意的)。 The button calls performSegueWithIdentifier, but it doesn't show the second view controller. 该按钮调用performSegueWithIdentifier,但未显示第二个视图控制器。 Aside my iffy technical language (only been IOS for a week, sorry) any idea what I'm doing wrong? 除了我那不熟练的技术语言(对不起,我刚上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];
}

OK, realised what I did wrong. 好的,意识到我做错了。 I had put an empty performSegueWithIdentifier method override. 我已经将空的performSegueWithIdentifier方法重写。 The danger of running before I can walk. 在我走路之前跑步的危险。 Thanks for all your help. 感谢你的帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM