I am currently stuck with a very weird problem. I am using iOS 6 and Xcode 4.5. I have a storyboard with a UIViewController
and a UIButton
in it. I
//Remove the view from the superview
UIView *view = yourButton.superview;
[yourButton removeFromSuperview];
//change frame of UIButton
CGRect bounds = view.bounds;
yourButton.center = CGPointMake(CGRectGetMidX(bounds), CGRectGetMidY(bounds));
//add this view again as a subview
[view addSubview:yourButton];