views:

194

answers:

1

I'm new to iPhone development. I'm reading that the "File Owner" in the xib is the responsible for instantiating all objects defined in the nib... some type of factory pattern comes to mind, but maybe I'm not looking at the big picture...

So, what would be the closest design pattern (gof) associated with the "File Owner" concept?

+1  A: 

File owner isn't really part of a design pattern.

File owner is really just a placeholder in Interface Builder for a specific class to be assigned later. If you look at the information panel in the inspector for file owner you will see it assigned a particular class. When the nib is for the main window, the class is UIApplication or a subclass. When its a view, the file owner class is usually some class of view controller. It could, however, be any class as long as that class could link to at least one other object in the nib.

Each nib does need a file owner to serve as the entry point for the nib. It's the object that other objects become aware of when the nib is loaded. But that is more of just a practicality instead of a design pattern.

TechZen
Got it. Simpler than I thought.
Padu Merloti