2013-06-17 3 views
-1
내가있는 tableView를 사용하고

의 번호를 입력하지 않습니다 그러나 여기에 코드 여기표 섹션의 수와 행

이 섹션과있는 tableView의 행의 수의 번호를 입력하지 않은 수의 코드는 섹션 및 행 수를 나타냅니다. 섹션 코드의 행의

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 
    { 


return 1; 

} 

번호는

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 

    { 

NSLog(@"Cell is"); 


return 1; 
} 

셀은

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 


    { 
static NSString *CellIdentifier = @"Cell"; 

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 
if (cell == nil) { 
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle 
            reuseIdentifier:CellIdentifier] autorelease]; 

    cell.selectionStyle=UITableViewCellSelectionStyleNone; 


} 


     MultipleDetailViewsWithNavigatorAppDelegate *appDelegate = (MultipleDetailViewsWithNavigatorAppDelegate *)[[UIApplication sharedApplication] delegate]; 

     cell.textLabel.font=[UIFont fontWithName:@"Helvetica" size:16]; 
     cell.textLabel.textAlignment=UITextAlignmentLeft;  

     PublishData *theCellData = [appDelegate.publishArray objectAtIndex:indexPath.row]; 

     NSLog(@"Cell is"); 


     cell.textLabel.text [email protected]"Test"; 




     return cell; 

} 당신이 테이블보기를 추가하는 방법

+0

대개 UIBuilder를 사용하는 경우 대리인 콘센트에 연결하지 않았을 가능성이 큽니다. 그리고 소스 코드에 관해서는 구현이 아니라 헤더를 제공하는 것이 더 낫습니다. 실수는 헤더 (아마도 소스 파일의 확장 블록에 있음) 또는 UIBuilder에있는 것입니다 – makaron

+0

데이터 소스를 설정하고 pls를 위임 – amar

+0

self.tableView.delegate = 본인; self.tableView.dataSource = self; – pbibergal

답변

0

값?. 인터페이스 빌더를 사용하여 추가 한 경우 tableview에 대한 데이터를 설정하십시오. 프로 그램을 추가 한 경우 [tableview setDatasoucre : self]를 설정하십시오.

2

테이블 뷰에 대한 데이터 소스 및 위임을 설정 했습니까? 나는 의심하지 않는다. 코드 또는 xib로 설정하고 확인하십시오.