Strange NSCollectionView Drag and Drop problem

Viewed 28

I'm creating an application that contains two NSCollectionView, one source, and one target, user drags the item from the source and drops to the target, the strange thing is that, if I run the App from Xcode, the drag & drop works perfectly(both validateDrop and acceptDrop were called), both Debug and Release. anyway, if I run the created application directly, the target collectionView won't show the line indicator and the dragging item always bounces back to the source collectionView, no validateDrop called.

 func collectionView(_ collectionView: NSCollectionView,
                        validateDrop draggingInfo: NSDraggingInfo,
                        proposedIndexPath proposedDropIndexPath: AutoreleasingUnsafeMutablePointer<NSIndexPath>,
                        dropOperation proposedDropOperation: UnsafeMutablePointer<NSCollectionView.DropOperation>) -> NSDragOperation {
        
        if collectionView == self.targetMovCollectionView
        {
            draggingInfo.animatesToDestination = true
            return .move
        }
        return [];
        
    }

 

What might be the issue?

1 Answers

Nothing technical, purchased one M1 Pro MacBook, installed Xcode 14, and use new Xcode 14 to build the project with Universal target, both running via binary and running from Xcode are working as expected, the problem just disappeared w/o any code updated. Dunno what was going on.

Related