The x origin depend of the width of the superview (in my example self.view)
#define RIGHT_MARGIN 20
myButton.frame = CGRectMake(self.view.frame.size.width - myButton.frame.size.width - RIGHT_MARGIN, yValue, myButton.frame.size.width, myButton.frame.size.height)