I have a tableview cell that needs to look like this:

Basically I have a label on the left side that will always remain the same length. That is no problem. On the right side I have a label that will change in length, for instance it will contain someone’s name which obviously varies from person to person. That label needs to be right aligned on the cell, also no problem.
The problem is that on the left of the dynamic label, I want to have an static UIImage, that will be say 10 pixels from the dynamic label, but will move with it.
Thoughts?
This is the current code, the image is a subview of the label, but obviously not moving dynamically.
// Add text label
UILabel *textLabel = [[UILabel alloc] initWithFrame:CGRectMake(20.0, 0.0, 80.0, 45.0)];
textLabel.backgroundColor = [UIColor clearColor];
textLabel.text = @"Account";
textLabel.opaque = NO;
textLabel.textColor = [UIColor colorWithRed:143/255 green:143/255 blue:143/255 alpha:.6];
textLabel.font = [UIFont boldSystemFontOfSize:15];
textLabel.shadowColor = [UIColor whiteColor];
textLabel.shadowOffset = CGSizeMake(0.0, 1.0);
//Add the image
UIImage *image = [UIImage imageNamed:@"image.png"];
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 13.5, 18, 18)];
[imageView image];
// Add the Next Value label
UILabel *valueLabel = [[UILabel alloc] initWithFrame:CGRectMake(170, 0.0, 100, 45.0)];
valueLabel.textAlignment = UITextAlignmentRight;
valueLabel.textColor = [UIColor colorWithRed:143/255 green:143/255 blue:143/255 alpha:.6];
valueLabel.backgroundColor = [UIColor clearColor];
valueLabel.opaque = NO;
valueLabel.font = [UIFont systemFontOfSize:15];
valueLabel.text = [[NSUserDefaults standardUserDefaults] valueForKey:@"name"];
[cell addSubview:textLabel];
[cell addSubview:valueLabel];
[valueLabel imageView];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
Try this code:
I am sure there are cleaner solutions but I just pounded this out quickly. This forces the image view to dynamically change with the right label. If this is not exactly what you are looking for let me know. I just based this on the information I had.