Howto eliminate the delay for the first call of -(NSMenu*)menuForEvent: (NSTableView class)?
Howto eliminate the delay for the first call of -(NSMenu*)menuForEvent: (NSTableView class)?
- Subject: Howto eliminate the delay for the first call of -(NSMenu*)menuForEvent: (NSTableView class)?
- From: Nick <email@hidden>
- Date: Sun, 05 Jun 2011 15:28:12 +0300
Hello!
I am trying to add a context menu to the NSTableView. For this purpose, I
have subclassed NSTableView, and implemented this method:
-(NSMenu*)menuForEvent:(NSEvent*)evt
{
NSPoint point = [self convertPoint:[evt locationInWindow]
fromView:NULL];
int column = [self columnAtPoint:point];
int row = [self rowAtPoint:point];
if ( column >= 0 && row >= 0) {
if([self selectedRow] != row)
[self selectRow:row byExtendingSelection:NO];
return [[NSApp delegate] popupMenu];
} else
return nil;
}
In Interface Builder I am instantiating my NSMenu and binding it with the
outlet in the <NSApplicationDelegate> class, which also has this NSMenu as a
property.
Everything works fine, except that when the user clicks first time on the
TableView after application has loaded, i get this
"__CFServiceControllerBeginPBSLoadForLocalizations
timed out while talking to psb" message in the console output, and a few
seconds delay before the menu appears. All subsequent clicks on the view
make the context menu appear normally, without any delays or messages in the
console.
Why does this happen?
Have I forgotten something?
Thanks for the response!
Nick
_______________________________________________
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