- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
UIViewController *destinationViewController = segue.destinationViewController;
if ([destinationViewController respondsToSelector:@selector(setString:)]) {
// TaskDetailViewController *VC = (TaskDetailViewController *)destinationViewController;
// VC.delegate = self;
NSIndexPath *indexPath = [self.tableView indexPathForCell:sender];
// VC.string = [self.taskArray objectAtIndex:indexPath.row];
// VC.indexpath = indexPath;
//KVC
[destinationViewController setValue:self forKey:@"delegate"];
[destinationViewController setValue:[self.taskArray objectAtIndex:indexPath.row] forKey:@"string"];
[destinationViewController setValue:indexPath forKey:@"indexpath"];
}
}
UIViewController *destinationViewController = segue.destinationViewController;
if ([destinationViewController respondsToSelector:@selector(setString:)]) {
// TaskDetailViewController *VC = (TaskDetailViewController *)destinationViewController;
// VC.delegate = self;
NSIndexPath *indexPath = [self.tableView indexPathForCell:sender];
// VC.string = [self.taskArray objectAtIndex:indexPath.row];
// VC.indexpath = indexPath;
//KVC
[destinationViewController setValue:self forKey:@"delegate"];
[destinationViewController setValue:[self.taskArray objectAtIndex:indexPath.row] forKey:@"string"];
[destinationViewController setValue:indexPath forKey:@"indexpath"];
}
}