The File Owner is an instantiated, runtime object that owns the contents of your nib and its outlets/actions when the nib is loaded. It can be an instance of any class you like - take a look at the identity tab of the tool palette.

For example, consider you have a UIViewController subclass with an IBOutlet for a UILabel. In interface builder the File's owner will be set to the same class as your UIViewController. When your nib is loaded at runtime, the bindings of outlets and actions defined in your nib are bound to the instance of your view controller, as your view controller is the owner.

Nibs are loaded using:

[[NSBundle mainBundle] loadNibNamed:@"NibName" owner:nil options:nil];

The owner parameter is particularly important. That's the runtime instance of a class that owns the contents (outlets, actions and objects) of the nib being loaded.

Hopefully that's clear. To see this at work create a brand new iPhone project with a view controller. Open the Nib file and take a look at the identity tab.

First responder is simply the first object in the responder chain that can respond to events. The responder chain is a runtime collection (or more accurately a hierarchy) of objects that can respond to an event. For example, consider you have a window with a view and on that view is a text field.

If that text field has focus it's known as the first responder in the chain. So if you send a message to the first responder it'll be sent to the text field first. If the text field can't handle the message it'll be sent to the next responder. And the next. And the next, until you get to the end of the responder chain or something has consumed the event (iirc).

The responder chain is worth reading about - hit apple's documentation for more information.

The File's Owner的更多相关文章

  1. [转]ios 开发file's owner以及outlet与连线的理解

    转载地址:http://www.cocoachina.com/bbs/simple/?t108822.html xib文件本身可以看做是一个xml,app启动的时候会根据xml构造xib对应的界面及其 ...

  2. 【iOS】Xib的使用与File'Owner总结

    一.XIB的适用范围 xib(也叫Nib)与storyboard一样是用来描写叙述界面的. storyboard描写叙述的是比較大型的,大范围.适合描写叙述界面跳转等. 二.XIB的使用 Xib是小范 ...

  3. nib 加载过程分析以及对File’s Owner的理解

    nib loading的过程,这个是app文档里面有说到资源编程指南 1.  It loads the contents of the nib file and any referenced reso ...

  4. file's owner以及outlet与连线的理解

    转自:http://www.cnblogs.com/martin1009/archive/2012/06/01/2531028.html xib文件本身可以看做是一个xml,app启动的时候会根据xm ...

  5. 在使用完全拷贝过来的类文件(带xib文件)时,要及时修改 File's Owner

  6. Xib的使用与File'Owner总结

    Xib的使用与File'Owner总结 一.XIB的适用范围 xib(也叫Nib)与storyboard一样是用来描述界面的. storyboard描述的是比较大型的,大范围.适合描述界面跳转等. 二 ...

  7. File System Programming --- (二)

    File System Basics The file systems in OS X and iOS handle the persistent storage of data files, app ...

  8. Linux字符设备驱动框架

    字符设备是Linux三大设备之一(另外两种是块设备,网络设备),字符设备就是字节流形式通讯的I/O设备,绝大部分设备都是字符设备,常见的字符设备包括鼠标.键盘.显示器.串口等等,当我们执行ls -l ...

  9. iOS UINavigationController(内容根据iOS编程编写)

    我们知道 UITabBarController 对象,可以通过使用该对象,用户可以切换不同的屏幕.当要切换的各个屏幕之间没有相互依存关系的时候,该对象可以很好的完成任务.但是当多个屏幕互有关系的时候, ...

随机推荐

  1. AAABBBBCCCC

    语单词词性简写语的意义:,n. 名词 ,noun的缩写v. 动词 , verb的缩写pron. 代词 , pronoun的缩写adj. 形容词, adjective的缩写adv. 副词, adverb ...

  2. PHP curl 采集内容之规则 1

    <?phpheader("Content-type:text/html; charset=utf-8");$pattern = '/xxx(.*)yyyy/isU'; //i ...

  3. 数据库(MSSQLServer,Oracle,DB2,MySql)常见语句以及问题(续1之拼接字符串)

    上一篇文章http://www.cnblogs.com/valiant1882331/p/4056403.html写的太长了,所以就换了一篇,链接上一节继续 字符串的拼接 MySql中可以使用&quo ...

  4. php远程读取json的方法

    <?php /** * @author 懒人 <service@kuitao8.com> * @since 2.0 */ header("Content-type:text ...

  5. #Leet Code# Populating Next Right Pointers in Each Node II

    描述:注意需要先self.connect(right)再self.connect(left),否则会有case通不过,原因是左边递归执行时依赖与右边的next已经建立,而先执行connect(left ...

  6. 4种方法生成二维码 (js 控制canvas 画出 二维码)

    随着网络的迅速发展 发展 发展,二维码的应用将会越来越多.同时很多只是很平凡的二维码,请拿起你的手 把这个二维码 设计起来吧.下面分享了几个非常好的二维码设计.  二维码原理: 二维条码/二维码可以分 ...

  7. 简洁代码---python---string

    判断字符串是否是回文的,即是否中心对称的: >>>return s[::-1] == s 对称返回True, 否则返回False

  8. [日语歌词] If

    原唱:西野カナ (にしのカナ) 作词:西野カナ/GIORGIO 13 作曲:GIORGIO CANCEMI 1.单词表 仮名 漢字 ひ 日 あめ 雨 や 止 ちがい 違い とおり 通り じかん 時間 ...

  9. S3C2440的LCD虚拟显示测试

    一.概述   S3C2440的LCD控制器支持虚拟显示,说的容易理解一点就是,可以显示比实际显示器大的图像.可以这样想象,有一个大的图片,但是显示器(显示串口)比较小,但是我们可以相对于大图片(即大图 ...

  10. 【STM32】STM32 GPIO模式理解

    stm32的GPIO的配置模式有好几种,包括: 1. 模拟输入: 2. 浮空输入: 3. 上拉输入: 4. 下拉输入: 5. 开漏输出: 6. 推挽输出: 7. 复用开漏输出: 8. 复用推挽输出 如 ...