2
나는 it.There에있는 내용의 배열 UItableview가 두 개의 배열이 있습니다, 나는 버튼 클릭을 사용하여 배열을 전환하고 싶습니다. 내 코드는버튼 클릭으로 UITableView의 내용을 변경하는 방법은 무엇입니까?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
tab.backgroundColor = [UIColor clearColor];
tab.separatorColor = [UIColor clearColor];
cell.chapterAndVerse.text = [NSString stringWithFormat:@"%d",indexPath.row+1];
cell.chapterAndVerse.font = [UIFont fontWithName:@"Georgia" size:17.0];
cell.chapterAndVerse.frame=CGRectMake(0, 10, 30.0, 20.0);
cell.textLabel.text = [NSString stringWithFormat:@" %@",[delegate.allSelectedVerseMalayalam objectAtIndex:indexPath.row]];
cell.textLabel.font = [UIFont fontWithName:@"testfont" size:18];
cell.backgroundColor = [UIColor clearColor];
}
내 배열은 delegate.allSelectedVerseMalayalam, 내가 영어의 버튼은 (는) tableviewcontent을 변경하는 사용자가 클릭 click.When이 배열은 버튼에 delegate.allSelectedVerseEnglish로 변경하려면 (내 테이블 이름은 탭입니다.) delegate.allSelectedVerseEnglish.이게 어떻게 가능합니까?이 문제를 해결할 수 있도록 도와주세요. 미리 감사드립니다. 편집 :
cell.chapterAndVerse.text = [NSString stringWithFormat:@"%d",indexPath.row+1];
cell.chapterAndVerse.font = [UIFont fontWithName:@"Georgia" size:17.0];
cell.chapterAndVerse.frame=CGRectMake(0, 10, 30.0, 20.0);
cell.textLabel.text = [NSString stringWithFormat:@" %@",[tempArray objectAtIndex:indexPath.row]];
// cell.textLabel.textColor = [UIColor darkGrayColor];
cell.textLabel.font = [UIFont fontWithName:@"testfont" size:18];
cell.backgroundColor = [UIColor clearColor];
소스 파일에 배열을 정의하십시오. 델리게이트 배열이 먼저 존재하는지 확인하십시오. viewDidLoad 배열을 인쇄하십시오 – Hiren
배열이 있는지 확인 했습니까? 콘솔에 어레이를 인쇄하려면 코드에 NSLog가 있습니까? – Hiren
해 보셨습니까? – Hiren