Update: Instead of using locFeedcell.lbl_location.bounds.origin.x+width
use locFeedcell.lbl_location.frame.origin.x+width
. bounds.origin.x
is always 0
.
Maybe Auto Layout is enabled in your .xib
file? Check the file inspector tab in the utilities pane.
If this doesn't help, can you post the values for the frame before and after you set them? Remember the memory address for your label and button and print their frames again after everything is laid out.
A quick tip:
You can use CGRectGetMaxX(locFeedcell.lbl_location.frame)
instead of locFeedcell.lbl_location.bounds.origin.x+width
to get the right edge from the frame.