Adding an NSTrackingArea does not work if I add it from another object than the view that I am adding it to, using this code:
It works if I do the same in gameView, with "gameView" replaced by "self" in the code. What is the problem?
Code:
NSTrackingArea *area = [[NSTrackingArea alloc] initWithRect:areaRect options:(NSTrackingMouseEnteredAndExited | NSTrackingActiveInKeyWindow) owner:gameView userInfo:nil];
[gameView addTrackingArea: area];