Question: I have this code:

```
cell.textLabel.text = [arrBugs objectAtIndex:indexPath.row];
cell.detailTextLabel.text = @"just a text";
cell.imageView.image = [UIImage imageNamed:[arrImages objectAtIndex:indexPath.row]];
cell.textLabel.textAlignment = UITextAlignmentRight;
cell.detailTextLabel.textAlignment = UITextAlignmentRight;

```

when the `cell.detailTextLabel.text` is not there, the `textLabel` aligning to right without any problem, but once I'm adding the `cell.detailTextLabel.text` they are both aligning to the left. how can I fix this issue? I want them both to be aligning to the right.

I don't use a custom table view cell.

Answer: 
For this kind of problem it is important to know how your cell is setup:
When you create the cell in the Storyboard editor you could not change all settings later in code. 
Only when you create the cell in code you might be able to change all settings.

However please reply what are the settings of your cell on creation.

Having done a simple project, with a cell having a style "right detail" I have no problems with only using the two text assignments.

May be you are trying to change the alignment on a per cell basis.
You can create your own UITableViewCell too by subclassing UITableViewCell then create your own xib file and place the labels in the positions you want them to have.
When creating the rows you will need to load the newly created xib file.
Here is a tutorial: <http://www.highoncoding.com/Articles/823_Creating_a_Custom_UITableViewCell.aspx>