2012-05-15 4 views
0

xmlparser에서 작업 중이며 [this xml]에서 mytableview로 데이터를 표시하고 있습니다. 보시다시피 첫 번째 줄은 다른 줄과 정렬되지 않습니다.Tableview 첫 번째 행이 정렬되지 않았습니다.

이은 행이 채워집니다 방법입니다 : 내가 뭔가를 분명 실종

// Customize the appearance of table view cells. 
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    static NSString *CellIdentifier = @"Cell"; 

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

    // Configure the cell. 
    cell.textLabel.text = [((AlbumObject *)[listFeed objectAtIndex:indexPath.row]) title]; 

    return cell; 
} 

건가요? 당신은 '문제가 내가 나오지 않았어 일부 공백 제안했다으로

[currentStringValue appendString:[string 
          stringByTrimmingCharactersInSet:[NSCharacterSet 
                   whitespaceAndNewlineCharacterSet]]]; 
+1

항목 앞에 다양한 수의 공백이있을 수 있습니까? NSLog에서 셀을 표시 할 때 제목을 인쇄하여 그 경우인지 확인하십시오. –

답변

0

: 당신이 문제는 내가 해결 xml.This에서 볼 수있는 몇 가지 공백을 제안했다으로

enter image description here

이 해결 t에서 볼 수 xml.This 해결 :

[currentStringValue appendString:[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]]; 
관련 문제