• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Howto eliminate the delay for the first call of -(NSMenu*)menuForEvent: (NSTableView class)?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Howto eliminate the delay for the first call of -(NSMenu*)menuForEvent: (NSTableView class)?
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: iOS: Manually setting orientation makes a mess out of my interface
  • Next by Date: [ANN] CoreParse
  • Previous by thread: Re: iOS: Manually setting orientation makes a mess out of my interface
  • Next by thread: Re: Howto eliminate the delay for the first call of -(NSMenu*)menuForEvent: (NSTableView class)?
  • Index(es):
    • Date
    • Thread