2

ネストされたNSViewがたくさんあり、これらの通知によってアプリケーションの速度が大幅に低下しています。

NSViewには、通知を制御するための次のメソッドがあります。

  • setPostsFrameChangedNotifications:
  • postFrameChangedNotifications
  • setPostsBoundsChangedNotifications:
  • postsBoundsChangedNotifications

ただし、NSViewDidUpdateTrackingAreasNotificationの制御については何もわかりません。誰かがこれがどのように行われるか知っていますか?

4

1 に答える 1

0

この回避策は私にとってはうまくいきました。ただし、内部メソッドをオーバーライドすることはお勧めしません。

- (void)_updateTrackingAreas 
{
    //NSLog(@"currentEvent: %@", [NSApp currentEvent].description);

    // Is it currently visible?
    if (NSEqualRects(self.visibleRect, NSZeroRect)) { 
         // No, don't update its tracking area.
        return;
    }

    [super _updateTrackingAreas];
}
于 2012-07-12T20:15:43.500 に答える