uitableviews에서 상세보기로 객체를 전달하는 방법은 무엇입니까? 난 당신이 내 방식에서 볼 수 있듯이, 조건부 푸시을 설정 한 :didSelectRowAtIndexPath를 사용하여 객체 전달하기 :
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
Budget * tempBudget = [self.budgetPlan.budgets objectAtIndex:indexPath.row];
NSString *targetViewControllerIdentifier = nil;
if (tempBudget.hasBeenInitialized != true) {
targetViewControllerIdentifier = @"budgetInitializerView";
UIViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:targetViewControllerIdentifier];
[self.navigationController pushViewController:vc animated:YES];
// how do I pass the tempBudget to the pushed view?
} else {
targetViewControllerIdentifier = @"budgetDetailsView";
UIViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:targetViewControllerIdentifier];
[self.navigationController pushViewController:vc animated:YES];
// how do I pass the tempBudget to the pushed view?
}
}
나는 보통 UIViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:targetViewControllerIdentifier];
에 문제가있어, 난 그냥 대답으로 vc.budget = tempbudget 설정 아래 제시되지만 예산 속성을 이해하지 못하는 것 같습니다.
수 당신은 "예산 재산을 이해하지 못하는 것"에 대해 자세히 설명합니까? 컴파일러 경고? 추락? 새보기에 아무 것도 표시되지 않습니까? –
새보기에 아무것도 표시되지 않습니다. 그것은 통과하지 않는 것 같습니다. – iggy2012