1

내부에있는 UITableViewController에서 UINavigationController가를 만듭니다. 해당 제품의 세부 사항을 의 UIViewController를 표시 할 UINavigationController가를 엽니 다 있는 UITableViewController 내부의 세포 중 하나를 클릭하면내가 <strong>의 기반 UITabBarController가</strong>를 사용하여 응용 프로그램을 가지고 있고, 탭 중 하나 안에 내가 모든 것을 완벽하게 작동하고 여기까지 "제품"을 표시 <strong>있는 UITableViewController</strong>이 UITabBarController가

는 이제합니다.

나는 응용 프로그램 계층은 다음과 같이해야한다고 생각 :

UITabBarController (BASE) Level-1 
    | 
    |___ UITableViewController (PRODUCTS) Level-2 
     | 
     |___ UINavigationController Level-3 
       | 
       |___ UIViewController (PRODUCT DETAILS) Level-4 

어떻게 레벨 3 달성 레벨 4?

감사합니다 사전에 :)

답변

0

그냥이 튜토리얼을보세요. http://www.youtube.com/watch?v=LBnPfAtswgw

+0

도움이 감사합니다. @ 레골라스,이 튜토리얼은 Xcode3을 사용하여 수행되었습니다. 여기서는 Xcode4에서 사용하지 않는 단계가 있습니다! UIGavigationController를 사용하여 UIViewController 세부 정보를로드하려면 UITableViewController 셀을 클릭 할 수 있도록 추가 할 항목을 안내해 주시겠습니까? – DeZigny

5

먼저 당신은 이런 식으로 계층 구조를 다시 설정해야합니다 :

UITabBarController (BASE) 
    | 
    |___ UINavigationController 
     | 
     |___ UITableViewController (PRODUCTS) 
     | 
     |___ UIViewController (PRODUCT DETAILS) 

당신은 당신의 제품 세부 정보를 밀어하는 데 사용할 것이라고 TabBarController에 UINavigationController가를 추가해야합니다.

는 TabBarController에 UINavigation를 추가합니다 :

UITabBarController *tabBarController = [[UITabBarController alloc] init]; 

UINavigationController *tableNavController_1 = [[[UINavigationController alloc] initWithRootViewController:YourProductViewController_1] autorelease]; 
UINavigationController *table2NavController_2 = [[[UINavigationController alloc] initWithRootViewController:YourProductViewController_2] autorelease]; 

tabBarController.viewControllers = [NSArray arrayWithObjects:tableNavController_1, table2NavController_2, nil]; 

//then add the controller to view like, 
// this: 
[window addSubview:tabBarController.view]; 
[window makeKeyAndVisible]; 

//or this: 
[self.view addSubview:tabBarController.view]; 

을 당신이 각 ProductViewController에 대한 새로운있는 UITableViewController를 만든 다음 대리자 메서드를 사용하는 것이 좋습니다 :

DetailViewController *detailViewController = [[DetailViewController alloc] initWithNibName:@"Nib name" bundle:nil]; 
// Pass the selected object to the new view controller. 
[self.navigationController pushViewController:detailViewController animated:YES] 
[detailViewController release]; 
: 상세보기를 밀어위한 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
+0

나는 당신의 상세한 답변을 정말로 고맙게 생각하지만, 여전히 내가 초보자 인 것처럼 응용 프로그램을 다시 디자인하는 것이 어렵다. 테이블에 내비게이션을 추가하는 방법이 있다면 정말 좋을 것 같습니다. – DeZigny

+0

UITableViewController 내비게이션을 사용하려면 UINavigationController가 필요합니다. 특정 경우에는 UINavigationController "TabBarController"내부에 UINavigationController "inside"테이블을 추가해야합니다. 앞에 설명한대로 – Frade

+0

+1 계층 구조를 보여주는 첫 번째 차트 - 탭 컨트롤러 사이에 탐색 컨트롤러 배치 그리고 초기 테이블 뷰는 "세부 사항"뷰 작업에 대한 내 견해를 만들었습니다! – marc

관련 문제