Well, there is no [NSView setCursor: myCursor]. Definitely NOT. It’s simply incredible all you have to do to get a so common behavior!
First, I declare a NSTrackingArea inside the NSView initialization, like this:
Note that it took me one hour to understand the engineers’ language about the “options”. They must be combined. Then, as I wanted only the cursor update option, I implemented the cursorUpdate handler:
Then, in doubt – there are many doubts-- the resetCursorRects:
See, about ten lines to get a stupid cursor. and it does not work. What did I missed, or what’s wrong with this code?
That’s the kind of things that make me regret the good old days of QuickDraw. You could even define your cursors as resources, and fix the hot spot. Why are things becoming always more complicated? Why? :rolleyes:
replace self.frame with [self bounds].
btw: I recommend to use dot notation only if the receiver is explicitly declared as a property
replace NSTrackingActiveWhenFirstResponder+NSTrackingCursorUpdate with NSTrackingActiveInActiveApp | NSTrackingCursorUpdate
Combining masked constants you should use the boolean operator | rather than the numeric operator +
Without NSTrackingActiveInActiveApp you have to make the custom view first responder
Calling the method resetCursorRects is actually not necessary
Well, I succeed finally using the standard methods. Guess what? I just had to restart the Mac and everything is working. So: Clean Project: taradiddles. Restart Xcode: hot air. Restart Finder: nuts. Restart the Mac: whoopee.