Apologies in advance for this question, though it's been discussed at length since iOS came out. But I still don't get it, despite my best efforts. The closest image I can picture is "frozen and dried object graph", which is fine, but that doesn't help connecting the dots when it comes down to raw programming.
So, considering you can't really describe anything until you figure out what is does, let's take the following example:
1) I have a Xib file, say a UIView, with labels, and imageView
2) I have a classX, subclass from a UIView, that was attached to the Xib in IB's identity inspector. IB outlets, and IB actions are connected to this class, in the connection inspector. This class declares the IB/IA as properties.
3) I have a UIViewController, represented by a classVC. In this class I instantiate 1) using the standard [[NSBundle mainBundle] loadNibNamed:@"bla" owner:??? options:nil][0];
4) classX and classVC communicate via custom delegates, standard stuff.
Questions:
a)What is the XIB file's owner. 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 object graph is unfrozen and watered, shouldn't the runtime connect the Outlets has defined in 2) so what's the point of the file's owner in this case?
OR
If the XIB file Outlets are not connected to anything, does "File's owner" mean "I'm the class containing all the required OUtlets so that connections between that class instance and the decompressed XIB can be made ? (that's why I don't get it, because how would the association be made ???)
So, that's it. Just as dumb as before.
EDIT: I disagree with the fact that other answers are equally valid. I understand what they meant, but so far I have yet to understand what the owner parameter should hold for the case I describe, and most importantly, why.