Re: NSOutlineView dragging weirdness
Re: NSOutlineView dragging weirdness
- Subject: Re: NSOutlineView dragging weirdness
- From: Ken Thomases <email@hidden>
- Date: Thu, 22 May 2014 08:59:48 -0500
On May 21, 2014, at 10:10 PM, Graham Cox wrote:
> 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.
The most common reason for this sort of thing is a memory management bug. Something has a dangling reference to an object that has been incorrectly deallocated, a new object has taken its place, and it messages the new object as though it were the old object.
Try running with the Zombies template of Instruments.
Another possible culprit would be manipulation of the GUI from a background thread. That might also corrupt the view hierarchy's data structures resulting in the dangling pointer.
Regards,
Ken
_______________________________________________
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