First you create some custom UITableViewCell classes (.h and .m), as many xib files as you have:
That way you could use CellType1 and CellType2. CellType1.h would look like
#import <UIKit/UIKit.h>
@interface CellType1 : UITableViewCell
@property(nonatomic,strong) IBOutlet UILabel *customLabel;
@end
xib , , , UITableViewCell CellType1. CellType2.
TableViewController cellForRow :
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell=nil;
if(indexPath.row==<whatever you want>){
static NSString *CellIdentifier = @"CellType1";
cell =(CellType1*) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if(cell==nil){
NSArray *nib= [[NSBundle mainBundle] loadNibNamed:@"CellType1" owner:self options:nil];
cell = (CellType1 *)[nib objectAtIndex:0];
}
[cell.customLabel setText:@"myText"]
}
else{
static NSString *CellIdentifier = @"CellType2";
cell =(CellType2*) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if(cell==nil){
NSArray *nib= [[NSBundle mainBundle] loadNibNamed:@"CellType2" owner:self options:nil];
cell = (CellType2 *)[nib objectAtIndex:0];
}
[cell.customLabel setText:@"myText"]
}
return cell;
}