I have a table view with three different custom cells.Each will be loaded from three different cell classes.`
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier1 = @"CellIdentifier";
static NSString *CellIdentifier2 = @"Cell";
static NSString *CellIdentifier3 = @"Cell";
if (indexPath.section == 0)
{
CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier1];
if (cell == nil)
{
cell = [[[CustomCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier1] autorelease];
}
cell.datelabel.text=@"dhhg";
cell.nameLabel.text=@"shdhsjdj";
cell.msg.text=@"sdhhhfhjhfj";
cell.myImageView.image=[UIImage imageNamed:@"sd.png"];
cell.likelabel.text=@"hhhf";
return cell;
}
else
{
Customcellwithimage *cell = (Customcellwithimage *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier2];
if (cell == nil)
{
cell = [[[Customcellwithimage alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier2] autorelease];
}
cell.datelabel1.text=@"sdhkhks";
cell.nameLabel1.text=@"sdhjkhkshd";
cell.msg1.text=@"sdsdsd";
cell.myImageView1.image=[UIImage imageNamed:@"shdjhjhs"];
cell.likelabel1.text=@"sjdh";
cell.bannerview1.image=[UIImage imageNamed:@"dshjs"];
return cell;
}
return Nil;
}
` .This is my code for the design.Can anybody help me in where i am going wrong?