When do I not need to specify the file owner for the tip?

I read on File Owner here on Stack Overflow and several other resources, but I still have one question left. When do I need a File Owner for a tip? In Chapter 8, "Exploring the iPhone SDK" (a great book by the way), you create a column with a list of tables. The author says the following:

You might be wondering why we don't do anything with the File Owner icon. The reason is that we just don't need to. We are using this table cell to display data, but all user interaction will go through the table view, so it doesn't need its own controller class. We actually use nib as a kind of template to visualize our table cells.

It doesn't make sense to me. I was under the impression that all nib files require a File Owner, but obviously my understanding of this concept is not complete. Can anyone reiterate when and why I don't need to worry about the owner of the file?

+2


source to share


1 answer


According to what you quoted, the book says your file owner uses objects in nib, but objects in nib don't use File Owner, so you don't really need to set up File Owner at all IB.

You always have a File Owner because something is loading nib and that something is the file owner.



Moreover, even if the objects in nib do not use FO now, you can change them later to do this so that you can also configure FO every time.

Configuring the FO in IB also makes it easier to access the objects in the tip. After you tell IB which class is FO, you can create output variables in your header and IB will automatically detect them; then you can connect these outputs to IB and access objects by these variables in your code.

+3


source







All Articles