How to get indexpath in prepareForSegue

前端 未结 4 1030
予麋鹿
予麋鹿 2020-12-04 22:02
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender 
    {
    if ([segue.identifier isEqualToString:@\"Action\"])
    {
        NSIndexPath *indexP         


        
4条回答
  •  一整个雨季
    2020-12-04 22:17

    Like this

    - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(UITableViewCell *)sender {
        FTGDetailVC *detailVC = (id)segue.destinationViewController;
        NSIndexPath *indexPath = [self.tableView indexPathForCell:sender];
    
        FTGNote *note = self.notes[indexPath.row];
        [detailVC updateWithNote:note];
    }
    

提交回复
热议问题