나는 사용하고있는 푸시 성 segue가 있습니다. 그런 다음 데이터 푸시에 사용중인 segue를 준비합니다. 데이터를 푸는 데 긴장을 풀 필요가 있지만이를 결합하는 데 문제가 있습니다. 다음은 언 와인드 SEGUE 코드 -unwind segues를 사용하여 데이터 푸시
- (IBAction)unwindFromDetailViewController:(UIStoryboardSegue *)segue {
// ViewController *detailViewController = [segue sourceViewController];
NSLog(@"%@", segue.identifier);
}
그리고 여기가 SEGUE 코드에 대한 준비이다 -
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:@"showRecipeDetail"]) {
NSIndexPath *indexPath = nil;
Recipe *recipe = nil;
if (self.searchDisplayController.active) {
indexPath = [self.searchDisplayController.searchResultsTableView indexPathForSelectedRow];
recipe = [searchResults objectAtIndex:indexPath.row];
} else {
indexPath = [self.tableView indexPathForSelectedRow];
recipe = [recipes objectAtIndex:indexPath.row];
}
PersonDetailTVC *destViewController = segue.destinationViewController;
destViewController.recipe = recipe;
[self dismissViewControllerAnimated:YES completion:nil];
}
}
을 그리고 여기 내가있는이 SEGUE를 풀기하지만, 데이터를 밀어되지 시도 것입니다.
- (IBAction)unwindFromDetailViewController:(UIStoryboardSegue *)segue {
if ([segue.identifier isEqualToString:@"CustomTableCell"]) {
NSIndexPath *indexPath = nil;
Recipe *recipe = nil;
if (self.searchDisplayController.active) {
indexPath = [self.searchDisplayController.searchResultsTableView indexPathForSelectedRow];
recipe = [searchResults objectAtIndex:indexPath.row];
} else {
indexPath = [self.tableView indexPathForSelectedRow];
recipe = [recipes objectAtIndex:indexPath.row];
}
PersonDetailTVC *destViewController = segue.destinationViewController;
destViewController.recipe = recipe;
[self dismissViewControllerAnimated:YES completion:nil];
}
}
같은 질문에 대한 재 게시는 계속하고 있지만 이미 정확한 주제에 대한 답변이 많은이 게시물로 이동했습니다. "나는 단편을 풀 때 데이터를 반환 할 수 있습니까?" http://stackoverflow.com/q/13038622/2274694. 나는 당신이 그것을 조사 할 것을 제안한다. –
질문에 답변이 없으면 같은 질문 3 번을 다시 게시하는 대신 명확하게하기 위해 작업하는 것이 좋습니다. –
* unwind segue *에 대한 식별자를 구체적으로 설정 했습니까? 나는 당신이 * segue * 식별자를 사용하고 있고 prepareForSegue에서'if ([segue.identifier isEqualToString : @ "showRecipeDetail"])'이 false를 반환하고 블록이 전혀 실행되지 않는다고 생각한다. (이 줄 :'[self dismissViewControllerAnimated : YES completion : nil];'은 불필요합니다.) –