2012-06-21 4 views
2

중첩 된 NSView가 많아서 이러한 알림을 사용하면 응용 프로그램 속도가 느려집니다. NSView NSViewDidUpdateTrackingAreas 알림 알림을 비활성화하는 방법은 무엇입니까?

  • postsBoundsChangedNotifications 그러나
  • , 내가 NSViewDidUpdateTrackingAreasNotifi를 제어에 대해 아무것도 볼 :

    • setPostsFrameChangedNotifications :
    • setPostsBoundsChangedNotifications는
    • postsFrameChangedNotifications

      는 NSView는 제어 알림 이러한 방법이있다 양이온. 누구든지 이것이 어떻게 이루어질 수 있는지 알고 있습니까?

    답변

    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]; 
    } 
    
    관련 문제