To set an order of initialization of objects at an application launch
It is possible to set an order of initialization of objects at an application launch?
For example: I have two objects in IB: myObj1, myObj2. Both of them implement method -initWithCoder: Properties of objects sets in IB. myObject2 Initialize is depend from properties of myObj1.
Question: Is exist methods that set order of objects initialization? I must be sure that myObj1 will ALWAYS be initialized before 开发者_运维百科myObject2 in runtime.
Thanks!
You should read "The Object Loading Process" in the Resource Programming Guide. Essentially if your design requires a specific loading order within the same nib, you're doing something wrong. You should put critical "once the contents of this nib/xib are loaded" code in -awakeFromNib.
If this doesn't answer your question well enough, it might be best to state exactly why the dependency you described exists.
精彩评论