Can someone explain the file owner in iOS

Sorry in advance for this question, although it has been discussed in detail since iOS. But I still do not understand this, despite all my efforts. The closest image I can imagine is a “frozen and dried graphic”, which is great, but it doesn’t help connect the dots when it comes to raw programming.

So, given that you cannot describe anything until you figure out what happens, let's look at the following example:

1) I have a Xib file, such as a UIView, with tags and imageView

2) I have a subclass of class X from UIView that was attached to Xib in the IB identity inspector. IB outputs and IB actions are connected to this class in the connection inspector. This class declares IB / IA as properties.

3) I have a UIViewController represented by a VC class. In this class I create an instance 1) using standard[[NSBundle mainBundle] loadNibNamed:@"bla" owner:??? options:nil][0];

4) classX and classVC exchange data through user delegates, standard materials.

Questions:

a) What is the owner of the XIB file. Honestly, I have no idea.

b) what do I put in [[NSBundle mainBundle] loadNibNamed:@"bla" owner:??? options:nil][0];for the owner parameter, and most importantly, why?

When the graph of an object is thawed and watered, should the runtime be connected to the Outlets specified in 2), so what is the file owner point in this case?

OR

If the output of the XIB files is not connected to anything, does the "owner of the file" mean "I am a class that contains all the necessary OUtlets so that I can establish connections between an instance of this class and the unpacked XIB? (Why I won’t get it, because how an association will be created ???)

, . , .

EDIT: , . , , , , , , , .

+5

All Articles