2009-09-10 3 views
0

appdelegate.m file.RtbfViewController에서 applicationdidfinishing 메소드로 코딩했습니다. infotController는 UItableviewcontrolleras.but입니다. 홈 탭을 클릭하면 table.what을 표시하지 않습니다. 누구든지 도울 수 있니?어떻게하면 우리는 탭 표시 줄 컨트롤러에서 UITableview를 연결할 수 있습니까?

tabBarController = [[UITabBarController alloc] init]; 
RtbfViewController *rtbfViewController = [[RtbfViewController alloc]  
              initWithStyle:UITableViewStyleGrouped]; 
rtbfViewController.tabBarItem.title = @"HOME"; 
InfoViewController *infoViewController = [[InfoViewController alloc] 
              initWithStyle:UITableViewStyleGrouped]; 
infoViewController.tabBarItem.title = @"INFO"; 
tabBarController.viewControllers = [NSArray arrayWithObjects: 
            rtbfViewController,infoViewController,nil]; 
tabBarController.customizableViewControllers = [NSArray arrayWithObjects:nil]; 

[window addSubview:tabBarController.view]; 
[window makeKeyAndVisible]; 

답변

2

테이블에 데이터를 아직 입력하지 않은 경우 테이블이 존재 함을 알 수 없습니다. 하위 클래스 RtbfViewControllerInfoViewController에 대한 코드를 보지 않고 이것이 자신의 문제인지 아닌지를 판별하는 것은 어렵습니다.

그냥 경우이 문제입니다 : 당신은 the UITableViewDataSource protocol를 구현하여 테이블에 데이터를 추가하고, 적어도 두 개의 필수 방법을 구현 거기에서 할 수

  • – tableView:cellForRowAtIndexPath:
  • – tableView:numberOfRowsInSection:

이고이 방법은 그룹화 된 테이블에 사용됩니다.

    (210)
  • – numberOfSectionsInTableView:

또한, 필요한 경우 UITableViewdataSource 인스턴스 변수를 설정하는 것을 잊지 마세요.

일반적으로 TableViewSuiteUITableView 관련 클래스에 대해 알아보기위한 Apple의 유용한 코드 예제입니다.

+0

대단히 감사합니다. –

관련 문제