Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
iOS Development
Touch Up Inside fine, Touch Down Not
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Mark FX" data-source="post: 1399363" data-attributes="member: 211556"><p>The First Responder cube object in the Interface Builder is an abstract class, that really</p><p>represents nil, in the standard Xcode templates the first responder is linked to the main window, and is the first place all user nil target action events are sent, then the window </p><p>forwards thes action events up the responder chain, </p><p></p><p>The main menu for the application in the standard template also has its methods connected</p><p>to the first resopnder, most controls views windows and the application itself are all in the</p><p>responder chain, if you want a particular control or project class to be the first responder,</p><p>then override the method below.</p><p></p><p>[CODE]</p><p>- (BOOL)canBecomeFirstResponder</p><p>{</p><p> return YES;</p><p>}</p><p>[/CODE]</p><p></p><p>For example</p><p></p><p>[CODE]</p><p>[[self view] becomeFirstResponder];</p><p>[/CODE]</p><p></p><p>If you want you control or class to resign being the first responder, then send it the message</p><p>below.</p><p></p><p>[CODE]</p><p>[[self view] resignFirstResponder];</p><p>[/CODE]</p><p></p><p>If your starting out as a beginner, then I would leave the standard project template first</p><p>responder set up as is, that way you can be sure that what ever view is currently on the</p><p>main window, it will recieve the user action events.</p><p></p><p>Regards Mark</p></blockquote><p></p>
[QUOTE="Mark FX, post: 1399363, member: 211556"] The First Responder cube object in the Interface Builder is an abstract class, that really represents nil, in the standard Xcode templates the first responder is linked to the main window, and is the first place all user nil target action events are sent, then the window forwards thes action events up the responder chain, The main menu for the application in the standard template also has its methods connected to the first resopnder, most controls views windows and the application itself are all in the responder chain, if you want a particular control or project class to be the first responder, then override the method below. [CODE] - (BOOL)canBecomeFirstResponder { return YES; } [/CODE] For example [CODE] [[self view] becomeFirstResponder]; [/CODE] If you want you control or class to resign being the first responder, then send it the message below. [CODE] [[self view] resignFirstResponder]; [/CODE] If your starting out as a beginner, then I would leave the standard project template first responder set up as is, that way you can be sure that what ever view is currently on the main window, it will recieve the user action events. Regards Mark [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
iOS Development
Touch Up Inside fine, Touch Down Not
Top