FROM : Keith Blount
DATE : Fri Apr 08 20:59:38 2005
Hello,
I need to update part of my display whenever the user
finishes typing in an NSTextView. According to the
docs,the best way to do this is using
NSNotificationQueue. I tried the following in an
NSTextView subclass:
- (void)didChangeText
{
[super didChangeText];
[[NSNotificationQueue defaultQueue]
enqueueNotification:[NSNotification
notificationWithName:_KBTextViewDidFinishTypingNotification
object:self] postingStyle:NSPostWhenIdle
coalesceMask:NSNotificationCoalescingOnName
forModes:nil];
}
I registered self as an observer of
_KBTextViewDidFinishTypingNotification. However, the
notification is still being sent on every letter typed
(typing fast), not when typing ends or pauses. Does
anybody know what I am doing wrong, or the best way of
coalescing notifications so that they are only sent
upon the user finishing typing?
Many thanks in advance,
Keith
__________________________________
Do you Yahoo!?
Make Yahoo! your home page
http://www.yahoo.com/r/hs
DATE : Fri Apr 08 20:59:38 2005
Hello,
I need to update part of my display whenever the user
finishes typing in an NSTextView. According to the
docs,the best way to do this is using
NSNotificationQueue. I tried the following in an
NSTextView subclass:
- (void)didChangeText
{
[super didChangeText];
[[NSNotificationQueue defaultQueue]
enqueueNotification:[NSNotification
notificationWithName:_KBTextViewDidFinishTypingNotification
object:self] postingStyle:NSPostWhenIdle
coalesceMask:NSNotificationCoalescingOnName
forModes:nil];
}
I registered self as an observer of
_KBTextViewDidFinishTypingNotification. However, the
notification is still being sent on every letter typed
(typing fast), not when typing ends or pauses. Does
anybody know what I am doing wrong, or the best way of
coalescing notifications so that they are only sent
upon the user finishing typing?
Many thanks in advance,
Keith
__________________________________
Do you Yahoo!?
Make Yahoo! your home page
http://www.yahoo.com/r/hs
| Related mails | Author | Date |
|---|---|---|
| Keith Blount | Apr 8, 20:59 | |
| Shawn Erickson | Apr 8, 21:31 |






Cocoa mail archive

