Thanks for the reply. Here is my code
- (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] autorelease];
}
if (isSearchOn) {
NSString *cellValue = [searchResult objectAtIndex:indexPath.row];
cell.textLabel.text = cellValue;
} else {
NSString *contact=[contactKeys objectAtIndex:[indexPath section]];
NSArray *contactSection=[contactNames objectForKey:contact];
if (indexPath.row != 0) {
if ( [[contactSection objectAtIndex:[indexPath row]] isEqualToString:[contactSection objectAtIndex:[indexPath row]-1]] )
{
return cell;
}
else
cell.textLabel.text=[contactSection objectAtIndex:[indexPath row]];
}
else
cell.textLabel.text=[contactSection objectAtIndex:[indexPath row]];
}
return cell;
}