I am unable to get drag and drop working on Catalyst while the same code works fine on iOS:
func tableView(_ tableView: UITableView, itemsForBeginning session: UIDragSession, at indexPath: IndexPath) -> [UIDragItem] {
let task = tasksBySection[indexPath.section][indexPath.row]
let itemProvider = NSItemProvider(object: task.taskID as NSString)
let dragItem = UIDragItem(itemProvider: itemProvider)
dragItem.localObject = task
return [dragItem]
}
The drag delegate function completes successfully and then I see the following error messages:
-[__NSCFType _stopDraggingUpdates]: unrecognized selector sent to instance 0x60000370c0c0
2020-03-09 16:32:41.967468-0700 MyApp[57587:599370] -[__NSCFType _setTarget:]: unrecognized selector sent to instance 0x60000370c0c0
2020-03-09 16:32:41.972714-0700 MySpp57587:599370] [General] -[__NSCFType _setTarget:]: unrecognized selector sent to instance 0x60000370c0c0
2020-03-09 16:32:41.991528-0700 MyApp[57587:599370] [General] (
0 CoreFoundation 0x00007fff384778ab __exceptionPreprocess + 250
1 libobjc.A.dylib 0x00007fff6e731805 objc_exception_throw + 48
2 CoreFoundation 0x00007fff384f6b61 -[NSObject(NSObject) __retain_OA] + 0
3 CoreFoundation 0x00007fff383dbadf ___forwarding___ + 1427
4 CoreFoundation 0x00007fff383db4b8 _CF_forwarding_prep_0 + 120
5 AppKit 0x00007fff3593b789 NSCoreDragTrackingProc + 2513
6 HIServices 0x00007fff36605eac DoTrackingMessage + 380
7 HIServices 0x00007fff3660531f CoreDragStartDragging + 939
8 AppKit 0x00007fff3593a720 -[NSCoreDragManager _dragUntilMouseUp:accepted:] + 1304
9 AppKit 0x00007fff35b8b19e _handleBeginDraggingSession + 105
10 CoreFoundation 0x00007fff383fb0ee __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
11 CoreFoundation 0x00007fff383fb014 __CFRunLoopDoObservers + 457
12 CoreFoundation 0x00007fff383f9b79 CFRunLoopRunSpecific + 409
13 HIToolbox 0x00007fff36f4f65d RunCurrentEventLoopInMode + 292
14 HIToolbox 0x00007fff36f4f39d ReceiveNextEventCommon + 600
15 HIToolbox 0x00007fff36f4f127 _BlockUntilNextEventMatchingListInModeWithFilter + 64
16 AppKit 0x00007fff355bfba4 _DPSNextEvent + 990
17 AppKit 0x00007fff355be380 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1352
18 AppKit 0x00007fff355b009e -[NSApplication run] + 658
19 AppKit 0x00007fff35582465 NSApplicationMain + 777
20 AppKit 0x00007fff358a569c _NSApplicationMainWithInfoDictionary + 16
21 UIKitMacHelper 0x00007fff693d08f1 UINSApplicationMain + 322
22 UIKitCore 0x00007fff76278273 UIApplicationMain + 2105
23 MyApp 0x0000000100188c0b main + 75
24 libdyld.dylib 0x00007fff6fa9f7fd start + 1
25 ??? 0x0000000000000003 0x0 + 3
)