Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Oct 3, 2004, 01:21 PM   #1
NusuniAdmin
Guest
 
NusuniAdmin's Avatar
 
Join Date: Nov 2003
Cocoa, getting focused control

How would I go about getting the currently focused control? I mean there has to be some method I am missing that will return an identifier for the currently focused control.

Also is there a method or something that is called each time a control gets focused and loses the focus.


The reason I am asking is I want some specific things to happen when a control gets its focus and when it loses it.
NusuniAdmin is offline   0 Reply With Quote
Old Oct 3, 2004, 03:03 PM   #2
iMeowbot
macrumors 601
 
iMeowbot's Avatar
 
Join Date: Aug 2003
You can call the window's firstResponder to get a pointer to the object with that status. Is that what you mean?

This article contains an example; see textObjectToSearchIn

Last edited by iMeowbot; Oct 3, 2004 at 03:26 PM.
iMeowbot is offline   0 Reply With Quote
Old Oct 3, 2004, 03:50 PM   #3
NusuniAdmin
Thread Starter
Guest
 
NusuniAdmin's Avatar
 
Join Date: Nov 2003
this may do what I want, thnx. I will try it out and see how it goes.
NusuniAdmin is offline   0 Reply With Quote
Old Oct 3, 2004, 07:37 PM   #4
NusuniAdmin
Thread Starter
Guest
 
NusuniAdmin's Avatar
 
Join Date: Nov 2003
hmm how come when resignFirstResponder i cannot edit the text in the text field?

like [self setStringValue:@"bla"]; does nothing at all in the resignFirstResponder method.
NusuniAdmin is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
How do I access a label on a different view controller? KiranPanesar iPhone and iPod touch Apps 0 Apr 15, 2011 05:28 PM
Quick question on focus Macnoviz Digital Video 9 Jan 2, 2011 03:43 AM
NSWindow can't get focus Vizin Mac Programming 4 Oct 13, 2009 04:43 PM
Where to get this control/controls? Sergio10 iPhone/iPad Programming 4 Sep 6, 2009 06:31 PM


All times are GMT -5. The time now is 12:08 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC