NSOutlineView dragging weirdness
NSOutlineView dragging weirdness
- Subject: NSOutlineView dragging weirdness
- From: Graham Cox <email@hidden>
- Date: Thu, 22 May 2014 13:10:43 +1000
I'm using NSOutlineView with view-based rows. I've set it up to allow drag and drop of a row. When the drag is initiated, it throws an exception with the following stack trace:
#0 0x00007fff8b6d4e4a in objc_exception_throw ()
#1 0x00007fff8d00412d in -[NSObject(NSObject) doesNotRecognizeSelector:] ()
#2 0x00007fff8cf5f322 in ___forwarding___ ()
#3 0x00007fff8cf5eea8 in __forwarding_prep_0___ ()
#4 0x00007fff88c69a1d in -[NSView _layerBackedDisplayRectIgnoringOpacity:inContext:isRootView:] ()
#5 0x00007fff88bf0104 in -[NSView displayRectIgnoringOpacity:inContext:] ()
#6 0x00007fff8900fb6f in -[NSTableView _drawView:withCellFrameUnion:inContext:] ()
#7 0x00007fff8901127f in __70-[NSTableView _dragImageForRowsWithIndexes:tableColumns:event:offset:]_block_invoke_2 ()
#8 0x00007fff86dc62ae in __NSIndexSetEnumerate ()
#9 0x00007fff890111fe in __70-[NSTableView _dragImageForRowsWithIndexes:tableColumns:event:offset:]_block_invoke ()
#10 0x00007fff86dc62ae in __NSIndexSetEnumerate ()
#11 0x00007fff89010c90 in -[NSTableView _dragImageForRowsWithIndexes:tableColumns:event:offset:] ()
#12 0x00007fff89011c8f in -[NSTableView _doImageDragUsingRowsWithIndexes:event:pasteboard:source:slideBack:startRow:] ()
#13 0x00007fff89012c11 in -[NSTableView _performClassicDragOfIndexes:hitRow:event:] ()
#14 0x00007fff88b79a99 in -[NSTableView _performDragFromMouseDown:] ()
#15 0x00007fff88b780c7 in -[NSTableView mouseDown:] ()
#16 0x00007fff88c7d0d1 in -[NSOutlineView mouseDown:] ()
#17 0x00007fff88b62a58 in -[NSWindow sendEvent:] ()
#18 0x00007fff88b015d4 in -[NSApplication sendEvent:] ()
#19 0x00007fff88951a19 in -[NSApplication run] ()
#20 0x00007fff8893c7a3 in NSApplicationMain ()
2014-05-22 13:01:47.040 <app redacted>[12101:303] -[<redacted> contentsAreFlipped]: unrecognized selector sent to instance 0x102105a00
The exception is an unrecognised selector of -contentsAreFlipped (which is a method of CALayer) and the target of the message is my class that is the <item> represented by this row of the table, part of my data model. This seems to be code that is building the drag image. My datasource's -outlineView:writeItems:toPasteboard: has already been called by this time and completed fine as far as I can see. I'm not explicitly using CALayers in my table implementation anywhere, and layer backing is not set in IB.
This code is a new implementation of an interface that I previously had working using cell-based rows, but is now using view-based rows. Otherwise things are much the same (except that the old code works and this doesn't). Why would the outline view be assuming that my data model object is a CALayer at this point? Why would it even be attempting to message the data model?
Anyone else run into this? It's probably my bug but I'm not seeing it, and *feels* like a framework bug. But surely drag/drop of view-based outline view rows has been tested and works? OS 10.9 and 10.9 SDK.
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden