I have a somewhat complex view that I put together in a separate (View-based template) project (the View Controller was represented with orange icon in MainWindow.xib). It's far enough along now that I've decided to move it into another project where it will be managed by a Navigation Controller. It is called from UINavigationController's fairly straightforward pushViewController: animated: method.
MyViewController has a corresponding nib file (perhaps some of my confusion is the class & nib are nearly identically named with only suffixes .m, .h, & .xib being different). When this was the initial view on launch in the initial project both awakeFromNib and initWithCoder would be called when it was instantiated. Now only viewDidLoad seems to get called.
I'm confused as to what/why there is such a difference?!? I've found some other threads on S.O. that are related but they still leave me scratching my head with answers like: "awakeFromNib is called when the controller itself is unarchived from a nib. viewDidLoad is called when the view is created/unarchived. This distinction is especially important when the controller's view is stored in a separate nib file."
The distinction seems to be dependent upon what, exacty, is being unarchived the View or the ViewController. So if the ViewController is being instantiated and pushed then I should only expect viewDidLoad to be called? and on the other hand if my ViewController has an IBOutlet (and an object VC object representing it that has been dragged into my Nib) then I can expect initWithCoder and awakeFromNib to both get called?
Can someone please help set me straight? Seems like it's more difficult to reuse these views/controllers if different methods are arbitrarily called in very specific circumstances...or, as is certainly the case, this is exactly why they're called in, rather, very specific circumstances..i just don't fully understand the delineation between each of the various methods yet.
Anyone care to help set me straight?