user427179
user427179

Reputation: 83

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!

Upvotes: 1

Views: 65

Answers (1)

Joshua Nozzi
Joshua Nozzi

Reputation: 61228

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.

Upvotes: 1

Related Questions