首先這是個在 nib 才有的東西我們先來看看官方文件 Resource Programming Guide 的解釋:
One of the most important objects in a nib file is the File’s Owner object. Unlike interface objects, the File’s Owner object is a placeholder object that is not created when the nib file is loaded. Instead, you create this object in your code and pass it to the nib-loading code. The reason this object is so important is that it is the main link between your application code and the contents of the nib file. More specifically, it is the controller object that is responsible for the contents of the nib file.
In Xcode, you can create connections between the File’s Owner and the other interface objects in your nib file. When you load the nib file, the nib-loading code recreates these connections using the replacement object you specify. This allows your object to reference objects in the nib file and receive messages from the interface objects automatically.
老實講說的並沒有很清楚,最重要的是這兩句:「The reason this object is so important is that it is the main link between your application code and the contents of the nib file. More specifically, it is the controller object that is responsible for the contents of the nib file.」
簡單講就是:File's Owner 是 nib file 跟 application 的連結
不過這還是沒辦法解釋到底為什麼當我要客製化一個 UIController 時,File's Owner 的 custom class 要填 UIController,然後 nib file 是要拖一個 UIView,為什麼不是拖一個 UIViewController 進來?