CollectionView : drag and drop
Hello,
I've 2 windows.
the first window : NSPanel with CollectionView
the second window : NSWindow + NSView
When i drag a NSImage from CollectionView (source) to NSView (destination), the drop doesn't work !
No drag methods in NSView are called.
*** In my NSCollectionView Delegate (NSImage with arrayController), i've been implemented these methods :
-(BOOL)collectionView:(NSCollectionView *)collectionView canDragItemsAtIndexes:(NSIndexSet *)indexes withEvent:(NSEvent*)event
- (BOOL)collectionView:(NSCollectionView *)cv writeItemsAtIndexes:(NSIndexSet *)indexes toPasteboard:(NSPasteboard *)pasteboard
*** In my NSView :
(id)initWithFrame:(NSRect)frame {
...
[self registerForDraggedTypes:[NSArray arrayWithObjects:NSPasteboardTypePNG,
NSFilenamesPboardType, nil]];
-(BOOL)collectionView:(NSCollectionView *)collectionView acceptDrop:(id < NSDraggingInfo >)draggingInfo index:(NSInteger)index dropOperation:(NSCollectionViewDropOperation)dropOperation
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
- (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender {
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender {
- (void)concludeDragOperation:(id <NSDraggingInfo>)sender {
- (void)drawRect:(NSRect)dirtyRect {
please, can you help me !
thanks you.
MacBook Pro, Mac OS X (10.6.8), XCode 4