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. MySQL常见错误类型

    MySQL常见错误类型:1005:创建表失败1006:创建数据库失败1007:数据库已存在,创建数据库失败1008:数据库不存在,删除数据库失败1009:不能删除数据库文件导致删除数据库失败1010: ...

  2. 解决DataGridView.DataSource重复赋值而不显示问题

    List<Person> list=new List<Person>(); ;i<;i++) { list.Add(new Person(){........}) } d ...

  3. jquery禁用a标签,jquery禁用按钮click点击

    jquery禁用a标签方法1 $(document).ready(function () { $("a").each(function () { var textValue = $ ...

  4. 【python】分片copy和等号的区别

    例一 >>> list1=[1,2,3,4]>>> list2=list1>>> list3=list1[:]>>> list1 ...

  5. URL传参中不能带特殊的字符以及处理方案

    有些符号在URL中是不能直接传递的,如果要在URL中传递这些特殊符号,那么就要使用他们的编码了.编码的格式为:%加字符的ASCII码,即一个百分号%,后面跟对应字符的ASCII(16进制)码值.例如 ...

  6. 《疯狂java讲义》笔记 1-5章

    1.编译语言和解释语言理解,摘自李刚老师的<疯狂Java讲义>第三版: 就是说,Java和.net都是编译型有事解释型语言.编译型就是根据不同平台编译成不同的可执行机器码,编译过程中会进行 ...

  7. BZOJ 1612: [Usaco2008 Jan]Cow Contest奶牛的比赛

    Description FJ的N(1 <= N <= 100)头奶牛们最近参加了场程序设计竞赛:).在赛场上,奶牛们按1..N依次编号.每头奶牛的编程能力不尽相同,并且没有哪两头奶牛的水平 ...

  8. QLGame 2d Engine Android端环境搭建(通过jni读取assets目录的文件)

    QLGame 2d Engine win端已经实现了一个动物的动画了,初步的东西已经完成,考虑在Android端也实现这些基本的东西,这样跨平台的引擎也就实现了! 要在Android下编程,首先要实现 ...

  9. 打造属于自己的Altium Designer 3D封装库,不需要懂专门的三维设计软件

    看到Andy_2020发的帖子“Altium Designer专题”之后,对Altium Designer的3D功能很感兴趣,着手自己做一个AD的3D封装库.刚开始按照Andy介绍的方法,学了两天So ...

  10. 【Xamarin挖墙脚系列:Xamarin开发环境配置需求】

    原文:[Xamarin挖墙脚系列:Xamarin开发环境配置需求] 前言 因为操作的全是大块头,加大你们的内存,CPU网上飙.... 卤煮的机器配置  最近的版本部署包,百度云离线下载:版本:Xama ...