File's Owner + First Responder

若如初见. 提交于 2019-12-03 20:43:55

Files Owner and First Responder are proxies for objects that will exist at runtime. Specifically, Files Owner represents the object which will be passed in for owner in the method [NSBundle loadNibNamed: owner]. You can specify, via the Attributes Info Panel, what kind of object owner will be. Once you've indicated what Files Owner is, you can make connections to it.

First Responder is your portal to the Responder Chain. You can add Actions to First Responder in the "Classes" tab of the document window. Next, connect buttons and menu items to First Responder so that they call the desired action. The first object in the responder chain that understands this action will be called.

See the Cocoa documentation for more information about how the responder chain works.

File's owner is the class which governed all the functionality for a xib.

First responder is a control which having focus for input or any kind of signal.(basically textfields becomes first responders).

Edit:

Files owner shows the class which having all links for all UIContol their delegate and datasource as well as their events.

-Files owner having all the IBOutlets for connecting with UI contols. -Files owner having all IBActions perform on certain events related with UIControls. -Represent by self(object for the current class). -Set delegate and datasource to self if you connect these with files owner.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!