Unable to set frame correctly before viewDidAppear

viewDidLoad is called when the class is loaded however no ui elements have been initialised and therefore any attempt to reference them will be overwritten or unavaliable during the initialisation process which happens between the viewDidLoad and viewDidAppear calls. Once all ui element have been initalised and drawn viewDidAppear is called. viewDidLoad – Called after … Read more

viewDidLoad getting called twice on rootViewController at launch

I had this same issue when my app was first launching. What I found was that in my MainWindow.xib file, I was setting both my App Delegate’s viewController outlet, and my Window’s rootViewController outlet to my root view controller. When you build a View Based project file in Xcode, your App Delegate’s didFinishLaunchingWithOptions will be … Read more

UIView – How to get notified when the view is loaded?

Depending on what kind of actions you need to perform, there are several techniques: -(id)initWithFrame:(CGRect)frame – UIView’s designated initializer; always sent to a UIView to initialize it, unless the view is loaded from a nib; -(id)initWithCoder:(NSCoder *)coder – always sent to initialize a UIView whenever the view is loaded from a nib; -(void)awakeFromNib – sent … Read more