Re: selectText of NSTextField on focus
Re: selectText of NSTextField on focus
- Subject: Re: selectText of NSTextField on focus
- From: Quincey Morris <email@hidden>
- Date: Mon, 06 Jul 2015 18:07:57 +0000
On Jul 6, 2015, at 10:54 , Richard Charles <email@hidden> wrote:
> [self performSelector:@selector(selectText:) withObject:self afterDelay:0];
I dunno, but I suspect that this isn’t good enough. You’re merely guessing that “on the next iteration of the run loop” is *after* the text field finished becoming first responder, but it may take time to get the text field into a state where its selection can be set.
I’d suggest you try selecting the text in a delegate method (textDidBeginEditing or controlTextDidBeginEditing) instead.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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