Getting the users typed text in a NSComboBox textfield
Getting the users typed text in a NSComboBox textfield
- Subject: Getting the users typed text in a NSComboBox textfield
- From: Paul Harvey <email@hidden>
- Date: Mon, 18 Dec 2006 11:30:42 +0000
I have a NSComboBox with an internal list of items, each a
capitalized word. I have been able to get the autocomplete to work
successfully but that is case sensitive and I want a case insensitive
autocomplete so I want to roll my own.
I am using - (BOOL)control:(NSControl *)control
textShouldBeginEditing:(NSText *)fieldEditor to detect when the user
types in the text field of the NSComboBox and this works great.
However, I have been unable to actually extract the contents of the
textbox itself!
After much searching within the Apple documentation and on the
internet, I've come to the end of my abilities. Please can someone
advise me. I would expect something like [textField stringValue] but
can't find anything remotely similar that doesn't generate a 'XXX
selector not recognized' in my Run Log.
Here's the code snippet. The NSComboBox is called brfBook:
- (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)
fieldEditor
{
// Auto complete (case insensitive method) the book typed in
if(control == brfBook) {
NSLog(@"Lookin for %@",[fieldEditor SOMETHING_HERE]);
}
return YES;
}
--
Paul Harvey
Lead Programmer
email@hidden
Hiddenfield Software
"Creating useful software for Mac OS X"
www.hiddenfield.com
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to
produce bigger and better idiots. So far, the Universe is winning.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden