I'm testing drag and drop in an NSView, but draggingEntered:
is never called.
Code:
#import <Cocoa/Cocoa.h>
@interface testViewDrag : NSView <NSDraggingDestination>
@end
@implementation testViewDrag
- (id)initWithFrame:(NSRect)frame
{
self = [super initWithFrame:frame];
if (self)
{
[self registerForDraggedTypes:[NSImage imagePasteboardTypes]];
NSLog(@"initWithFrame");
}
return self;
}
-(NSDragOperation)draggingEntered:(id<NSDraggingInfo>)sender
{
NSLog(@"draggingEntered");
return NSDragOperationEvery;
}
-(NSDragOperation) draggingUpdated:(id<NSDraggingInfo>)sender
{
NSLog(@"draggingUpdated");
return NSDragOperationEvery;
}
@end
In interface builder I add a subView
(class is set to testViewDrag
) to the main window. In log I can see the initWithFrame
log but when I drag nothing is shown in the log.
What am I missing ?