I'm trying to understand a view controller's lifecycle and I've read a few contradictory statements about awakeFromNib
. The docs say that all outlets should be set in awakeFromNib
but I see that it's not always true. What is the call's order between awakeFromNib
, prepareForSegue
and when do the outlets become available?
awakeFromNib vs Outlets - Do the outlets and segues set when we call awakeFromNib
413 Views Asked by Vitya Shurapov At
1
There are 1 best solutions below
Related Questions in IOS
- Sphinx4 fails to find resources
- How to config grammar for StreamSpeechRecognizer in CMUSphinx
- Sphinx4 breaks on AWS Elastic Beanstalk, works on dev machine
- Why is my Sphinx4 Recognition poor?
- R system() command error
- Build NEW Acoustic model, Dictionary , Language model for uncommon language speech recognition
- sphinx4 only recognize custom words
- Does sphinx api only support .wav file as input?
- Unknown CMN type 'batch' in pocketsphinx
- freeswitch pocketsphinx: install model language
Related Questions in SWIFT
- Sphinx4 fails to find resources
- How to config grammar for StreamSpeechRecognizer in CMUSphinx
- Sphinx4 breaks on AWS Elastic Beanstalk, works on dev machine
- Why is my Sphinx4 Recognition poor?
- R system() command error
- Build NEW Acoustic model, Dictionary , Language model for uncommon language speech recognition
- sphinx4 only recognize custom words
- Does sphinx api only support .wav file as input?
- Unknown CMN type 'batch' in pocketsphinx
- freeswitch pocketsphinx: install model language
Related Questions in UIVIEWCONTROLLER
- Sphinx4 fails to find resources
- How to config grammar for StreamSpeechRecognizer in CMUSphinx
- Sphinx4 breaks on AWS Elastic Beanstalk, works on dev machine
- Why is my Sphinx4 Recognition poor?
- R system() command error
- Build NEW Acoustic model, Dictionary , Language model for uncommon language speech recognition
- sphinx4 only recognize custom words
- Does sphinx api only support .wav file as input?
- Unknown CMN type 'batch' in pocketsphinx
- freeswitch pocketsphinx: install model language
Related Questions in LIFECYCLE
- Sphinx4 fails to find resources
- How to config grammar for StreamSpeechRecognizer in CMUSphinx
- Sphinx4 breaks on AWS Elastic Beanstalk, works on dev machine
- Why is my Sphinx4 Recognition poor?
- R system() command error
- Build NEW Acoustic model, Dictionary , Language model for uncommon language speech recognition
- sphinx4 only recognize custom words
- Does sphinx api only support .wav file as input?
- Unknown CMN type 'batch' in pocketsphinx
- freeswitch pocketsphinx: install model language
Related Questions in AWAKEFROMNIB
- Sphinx4 fails to find resources
- How to config grammar for StreamSpeechRecognizer in CMUSphinx
- Sphinx4 breaks on AWS Elastic Beanstalk, works on dev machine
- Why is my Sphinx4 Recognition poor?
- R system() command error
- Build NEW Acoustic model, Dictionary , Language model for uncommon language speech recognition
- sphinx4 only recognize custom words
- Does sphinx api only support .wav file as input?
- Unknown CMN type 'batch' in pocketsphinx
- freeswitch pocketsphinx: install model language
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Your view controller and its view hierarchy are loaded from separate nib files at runtime. Outlets to the view hierarchy aren't connected until the view hierarchy is loaded, which happens after the view controller is loaded. (I have explained this in more depth in this answer.)
Let's say you have a “master” view controller in a navigation controller. The master view controller performs a segue to push a “detail” view controller. Here's the order of events:
Detail view controller is loaded from its nib. If the storyboard scene contains other top-level objects, these are also loaded.
Detail view controller receives
awakeFromNib
: detail view controller's outlets to other top-level objects in the scene are connected, but outlets to the view hierarchy are not.Master view controller receives
prepareForSegue
with the segue pointing at the detail view controller.Segue asks navigation controller to push detail view controller.
Navigation controller asks detail view controller for its view, to add to the navigation controller's view hierarchy.
Detail view controller loads its view hierarchy nib. This connects the detail view controller's outlets to its view hierarchy.
All objects in the view hierarchy receive
awakeFromNib
.Detail view controller receives
viewDidLoad
.