[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOutlineView / GSArray exception linux-ppc

From: Wolfgang Lux
Subject: Re: NSOutlineView / GSArray exception linux-ppc
Date: Thu, 16 Jan 2014 09:52:16 +0100

Hi Riccardo,

> Hi Wolfgang,
> Wolfgang Lux wrote:
>> The problem seems to be that the IMAPView's implementation of the 
>> NSOutlineViewDataSource protocol is buggy. Apparently, the data source 
>> method -outlineView:numberOfChildrenOfItem: returns that the root of the 
>> outline view has one or more children, but then when the outline view 
>> requests these children with the -outlineView:child:ofItem: method, the data 
>> source returns nil for one of the children.
> http://svn.gna.org/viewcvs/gnustep-nonfsf/apps/gnumail/Bundles/Account/AccountEditorWindowController.m?r1=248&r2=257
> This fix was just too aggressive, I need to initialize the folders after 
> init, but before any of the gui setup code. I fixed that.

No. The real problem is elsewhere. In -outlineView:child:ofItem: you have
if (!item)
    return allFolders;
but in -outlineView:numberOfChildrenOfItem: you have
if (!item)
    return 1;
This is simply inconsistent. You should return [allFolders count] in the latter 
method and then it doesn't matter when allFolders is initialized. Of course, 
you have to notify the outline view when you add some content to allFolders so 
that the outline view can update its display accordingly.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]