Re: [SOLVED] Re: NSTextField responder chain question...
Re: [SOLVED] Re: NSTextField responder chain question...
- Subject: Re: [SOLVED] Re: NSTextField responder chain question...
- From: Joel Watson <email@hidden>
- Date: Sat, 22 Nov 2003 10:21:29 -0800
>
On Tuesday, October 7, 2003, at 06:48 PM, Henry McGilton wrote:
>
>
I admit this is flailing in the dark, but, in the view where you get
>
the key press
>
(or in its controller), try something like:
>
>
[view_or_controller setNextKeyView: gmsgTextField]];
>
[gmsgTextField selectText:self];
Hi everyone!
I've just started delving into learning Cocoa and have been looking
through some of the tutorials at MacDevCenter.com. I followed the
address book tutorial and have been working at adding some stuff to it.
Right now, I'm stuck with a similar problem to the one solved by the
above code. How I have it set up right now, there is a method
createRecord: that is called by addRecord: to create a record with the
information specified in some NSTextFields. The addRecord: method is
tied to an Add button. I couldn't see any way to make the fields reset
themselves at this point, so I made another function,
resetEntryFields:. Here is the relevant code:
- (void)resetEntryFields
{
[lastNameField setStringValue:@""];
[emailField setStringValue:@""];
[homePhoneField setStringValue:@""];
[firstNameField setStringValue:@""];
[boxView setNextKeyView: firstNameField];
[firstNameField selectText:self];
}
This is called in addRecord: right after createRecord: and right before
[tableView reloadData]. It works. However, it only works completely
when you actually press the button. I have it tied to the Return key.
When you press the return key to activate the button, the fields are
reset, but the focus isn't changed as I want. What's going on here? I'm
assuming it's thinking that you're entering data into the currently
select field and somehow this overrides the method I'm calling, but I'm
at a loss as to how to solve this. Any help would be great! Thanks!
-Joel
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.