Re: how to prevent TableView update on key repeat?
Re: how to prevent TableView update on key repeat?
- Subject: Re: how to prevent TableView update on key repeat?
- From: Graham Cox <email@hidden>
- Date: Fri, 04 May 2012 12:38:26 +1000
On 04/05/2012, at 11:25 AM, Marc Respass wrote:
> Excellent. Thank you again. [NSEvent keyRepeatInterval] returned 0.833333 so I set the delay to 0.9 and it works perfectly. What was a slow process is now as smooth as can be. It even works correctly if I hold the up/down arrow until I get to the end. The delay to display once I stop the repeat is not noticeable. I just moved my selection code to a method and replaced it with this
>
> [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(selectionDidChange) object:nil];
> [self performSelector:@selector(selectionDidChange) withObject:nil afterDelay:0.09];
You probably should do this as your last line:
[self performSelector:<blah> withObject:nil afterDelay:[NSEvent keyRepeatInterval] + 0.1];
because the key repeat rate is set by the user in the "Keyboard" system preferences and can change.
--Graham
_______________________________________________
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