Skip navigation.
 
mlRe: NSOutlineView assertion failure on redraw .. ?
FROM : Corbin Dunn
DATE : Thu Jul 03 18:00:03 2008

Hi Michael,

The assertion is definitely bad.

Can you please log a bug for this? Ideally, if you have a test case 
for it, please include that in the bug report.

To get you moving on the problem, please run it under the debugger and 
break on objc_exception_throw (I think that is hit with NSAssert), and 
try to get a backtrace (bt in gdb) for when it happens. That will tell 
me more information on what is wrong.

From the sound of it, it fells like something is reentering the 
expandItem: logic while after calling a reloadItem/data (or the reload 
was accidentally called from a callout/delegate method or side effect).

corbin


On Jul 2, 2008, at 2:35 PM, Michael Hanna wrote:

> I have an NSTreeController bound to a data model:
>
>        [m_rulesDMTreeController bind:@"contentArray"
>                            toObject:rulesDM
>                          withKeyPath:@"rules"
>                              options:nil];
>
> and an NSTableColumn(inside an nsoutlineview) bound to the tree
> controller.arrangedObjects.Name keypath. Infrequently, but not always,
> I will get an assertion error:
>
> 2008-07-02 14:13:19.387 Submit[390:10b] *** Assertion failure in
> -[NSOutlineView _expandItemEntry:expandChildren:startLevel:](),
> /SourceCache/AppKit/AppKit-949.33/TableView.subproj/NSOutlineView.m:
> 1003
> 2008-07-02 14:13:19.388 Submit[390:10b] Invalid parameter not
> satisfying: itemEntry->children == NULL
>
> This occurred when I ran this code:
>
> [cut]
>            //  make the cocoa bindings system be aware of the change
> with -mutableArrayValueForKey
>
>            NSMutableArray* sourceChildren = [sourceParent
> mutableArrayValueForKey:@"children"];
>            NSMutableArray* destinationChildren = [destinationParent
> mutableArrayValueForKey:@"children"];
>
>            //  re-parent the group we're moving and do the move 
> operation
>
>            [movedGroup setParentGuid:destinationParentGuid];
>
>            [self willChangeValueForKey:@"rules"];
>
>            [destinationChildren addObject:movedGroup];
>            [sourceChildren removeObject:movedGroup];
>
>            //  if the source parent has zero children, delete it from
> m_elements
>
>            if( [sourceChildren count] == 0 )
>            {
>                [self deleteRule:sourceParent allRuleGroups:[self 
> ruleGroups]];
>            }
>
>            [self didChangeValueForKey:@"rules"];
> [cut]
>
> I have an observer watching the "rules" data model and the assertion
> error occurs before the data model gets changed.
>
> This doesn't happen that frequently, but enough to be a concern. Any
> suggestions why the outlineview is re-populating before the data model
> changes(apparently)?
>
> Failing any reasonable workaround, is there a way I can detect when
> this assertion occurs so I can attempt a 'fallback' mechanism?

Related mailsAuthorDate
mlNSOutlineView assertion failure on redraw .. ? Michael Hanna Jul 2, 23:35
mlRe: NSOutlineView assertion failure on redraw .. ? Corbin Dunn Jul 3, 18:00