2012-07-27 5 views
0

json에서 데이터를 가져옵니다. 그것은 정상적으로 작동하지만 문제는 데이터가 tableView에 표시되지 않는다는 것입니다.데이터가 iPhone 테이블에 표시되지 않습니다.

NSLog를 사용하여 셀에 할당 한 값을 확인했지만 셀에 데이터가 표시되지 않습니다.

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 
{ 
    return 1; 
} 

// Customize the number of rows in the table view. 
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 
{ 
    int count = [surveyList count]; 
    NSLog(@"These are rows %d",count); 
    return [surveyList count]; 
} 

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    static NSString *CellIdentifier = @"Cell"; 
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 
    if (cell == nil) 
    { 
     cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease]; 
    } 
    ObjectData *data = [surveyList objectAtIndex:indexPath.row]; 
    NSString *testingClient = data.survey_title; 
    NSLog(testingClient); 
    NSString *cellText = testingClient; 
    return cell; 
} 
+0

테이블 뷰에 위임자를 할당했는지 확인하십시오. – DivineDesert

+0

예 저는 누군가에게 tableviewrealod 데이터가 문제를 일으키고 있다고 말한 적이 있지만 아무 것도 다시로드하지 않았다고 말했습니다. – user1553768

답변

1

누락되지 않았습니까?

[[cell textLabel] setText:testingClient]; 

셀이없는 셀에는 텍스트를 할당하지 않습니다.

+0

나는 또한 이것을주었습니다. – user1553768

1

해당 텍스트를 셀의 레이블에 지정해야합니다.

cell.textLabel.text = testingClient; 
+0

예이 같은 작업도 수행했습니다. – user1553768

+0

먼저 더미 데이터로드 시도 테이블에 .. 테이블이 채워지고 잘 작동하는지 확인하십시오. tableView를 만들기위한 튜토리얼을 찾으십시오 – Zaraki

관련 문제