Несколько пользовательских строк UITableView?
Я много искал, но не нашел ничего полезного, связанного с несколькими пользовательскими строками, мне нужно создать таблицу настроек для моего приложения, в которой мне нужно загрузить строки из файлов XIB, например:
ROW 1 = >> XIB 1.
ROW 2 = >> XIB 2.
ROW 3 = >> XIB 3.
ROW 4 = >> XIB 4.
Мой нынешний код:
<code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell=nil; //We use CellType1 xib for certain rows if(indexPath.row==0){ static NSString *CellIdentifier = @"ACell"; cell =(ACell*) [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if(cell==nil){ NSArray *nib= [[NSBundle mainBundle] loadNibNamed:@"ACell" owner:self options:nil]; cell = (ACell *)[nib objectAtIndex:0]; } //Custom cell with whatever //[cell.customLabelA setText:@"myText"] } //We use CellType2 xib for other rows else{ static NSString *CellIdentifier = @"BCell"; cell =(BCell*) [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if(cell==nil){ NSArray *nib= [[NSBundle mainBundle] loadNibNamed:@"BCell" owner:self options:nil]; cell = (BCell *)[nib objectAtIndex:0]; } //Custom cell with whatever //[cell.customLabelB setText:@"myText"] } return cell; } </code>