First method after touching a table view cell didSelectRowAtIndexPath or prepareforSegue?

后端 未结 1 762
暖寄归人
暖寄归人 2021-01-26 15:58

I have designed a table view of various books in sections according to their type.If user touches on cell ,a segue is performed to a new view controller which needs a book item.

相关标签:
1条回答
  • 2021-01-26 16:14

    I think you have to link segue not with cell but with view of the current view controller. In such case when you click on cell

    -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
    

    will not be called. Then in

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
    

    you can manualy perform segue:

    [self performSegueWithIdentifier:@"MySequeIdentifier" sender:self];
    
    0 讨论(0)
提交回复
热议问题