简体   繁体   中英

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. 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. Aside my iffy technical language (only been IOS for a week, sorry) any idea what I'm doing wrong?

- (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. The danger of running before I can walk. Thanks for all your help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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