NSEvent trackingArea 属性对mouseMoved事件无效

在mouseMoved事件里写theEvent.trackingArea运行时会崩

/* these messages are valid for enter and exit events */
@property (readonly) NSInteger trackingNumber;
@property (nullable, readonly) void userData NS_RETURNS_INNER_POINTER;
/
-trackingArea returns the NSTrackingArea that generated this event. It is possible for there to be no trackingArea associated with the event in some cases where the event corresponds to a trackingRect installed with -[NSView addTrackingRect:owner:userData:assumeInside:], in which case nil is returned. */
@property (nullable, readonly, strong) NSTrackingArea *trackingArea API_AVAILABLE(macos(10.5));

你可能感兴趣的:(NSEvent trackingArea 属性对mouseMoved事件无效)