locoboy
locoboy

Reputation: 38940

File's Owner + First Responder

What exactly does the File's Owner and First Responder Placeholder in Xcode represent?

Upvotes: 3

Views: 2859

Answers (2)

Ishu
Ishu

Reputation: 12787

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.

Upvotes: 1

Chetan Bhalara
Chetan Bhalara

Reputation: 10344

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.

Upvotes: 3

Related Questions