The File's Owner
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的更多相关文章
- [转]ios 开发file's owner以及outlet与连线的理解
转载地址:http://www.cocoachina.com/bbs/simple/?t108822.html xib文件本身可以看做是一个xml,app启动的时候会根据xml构造xib对应的界面及其 ...
- 【iOS】Xib的使用与File'Owner总结
一.XIB的适用范围 xib(也叫Nib)与storyboard一样是用来描写叙述界面的. storyboard描写叙述的是比較大型的,大范围.适合描写叙述界面跳转等. 二.XIB的使用 Xib是小范 ...
- nib 加载过程分析以及对File’s Owner的理解
nib loading的过程,这个是app文档里面有说到资源编程指南 1. It loads the contents of the nib file and any referenced reso ...
- file's owner以及outlet与连线的理解
转自:http://www.cnblogs.com/martin1009/archive/2012/06/01/2531028.html xib文件本身可以看做是一个xml,app启动的时候会根据xm ...
- 在使用完全拷贝过来的类文件(带xib文件)时,要及时修改 File's Owner
- Xib的使用与File'Owner总结
Xib的使用与File'Owner总结 一.XIB的适用范围 xib(也叫Nib)与storyboard一样是用来描述界面的. storyboard描述的是比较大型的,大范围.适合描述界面跳转等. 二 ...
- File System Programming --- (二)
File System Basics The file systems in OS X and iOS handle the persistent storage of data files, app ...
- Linux字符设备驱动框架
字符设备是Linux三大设备之一(另外两种是块设备,网络设备),字符设备就是字节流形式通讯的I/O设备,绝大部分设备都是字符设备,常见的字符设备包括鼠标.键盘.显示器.串口等等,当我们执行ls -l ...
- iOS UINavigationController(内容根据iOS编程编写)
我们知道 UITabBarController 对象,可以通过使用该对象,用户可以切换不同的屏幕.当要切换的各个屏幕之间没有相互依存关系的时候,该对象可以很好的完成任务.但是当多个屏幕互有关系的时候, ...
随机推荐
- jquery 中的 $("#id") 与 document.getElementById("id") 的区别
以前没注意过,认为jquery 中的 $("#air") 与 document.getElementById("air") 是一回事,指的是同一个东西.在今天写 ...
- thinkphp ajax检测是否数据可用
模板文件:如 index.html 模板文件如:(index.html) <form><input type="text" name="username ...
- 关于datagridview单元格不切换焦点无法获得新输入数据的问题解决方法
问题描述:将EXCEL中的数据导入到dataGridView中,然后通过点击toolStripButton对dataGrideView中的数据进行处理,在测试时,向dataGridView中的某个单元 ...
- PL/SQL学习(四)存储过程和函数
原文参考:http://plsql-tutorial.com/ PL/SQL存储过程 存储过程相当于一个有名字的PL/SQL块,经过第一次编译后再次调用时不需要再次编译 创建格式: CREATE [O ...
- [转]maven插件的开发
原文链接: http://clojure.iteye.com/blog/1124188 另一篇文章 http://blog.csdn.net/csfreebird/article/details/77 ...
- PHP接口(interface)和抽象类(abstract)
interface 定义了一个接口类,它里面的方法其子类必须实现.接口是类的一个模板,其子类必须实现接口中定义的所有方法. interface User{ function getHeight ...
- STM32之SD卡
目录 一.SD卡概述 1.定义 2.容量等级 3.SD卡框图 4.SD卡与TF卡的区别 二. SD卡内部结构 1. SD卡内部结构简图 2. 存储阵列结构图 3.Buffer 4.“存储阵列Block ...
- cocos2d-x笔记2: 编译到安卓的步骤与注意事项
博客地址: www.cnblogs.com/wolfred7464/ 不得不说,真心复杂,本篇博客总结的基本是最简最直接的步骤了,不用Cygwin和Ant的,当然用也可以... 以下用 %PROJEC ...
- 加密算法 - RSA算法二
RSA算法原理(二) 声明: 本文转自阮一峰 (http://www.ruanyifeng.com/blog/2013/07/rsa_algorithm_part_two.html) 有了这些知识, ...
- 不建议使用NSUserDefault存储大量数据
NSUserDefaults 其实是一个 plist 文件(有待验证),即使只是修改一个 key 都会 load 整个文件,不适合存储大量数据. NSUserDefaults是保存成文本格式的,容易被 ...