Re: outlineView:dataCellForTableColumn:item: repeated called w null tableColumn on Snow Leopard
Re: outlineView:dataCellForTableColumn:item: repeated called w null tableColumn on Snow Leopard
- Subject: Re: outlineView:dataCellForTableColumn:item: repeated called w null tableColumn on Snow Leopard
- From: Corbin Dunn <email@hidden>
- Date: Fri, 28 Aug 2009 15:13:37 -0700
On Aug 28, 2009, at 3:07 PM, David Melgar wrote:
I printed out all the calls.
What happening is:
1. My data source/delegate/controller initWithCoder method is
invoked. But its pointer to the document is not valid yet so it
doesn't have data.
2. outlineView:numberOfChildrenOfItem: method is invoked. It cannot
access the document and returns 0.
That's fine.
3. awakeFromNib is called. The root object (document) is now correct.
It doesn't seem correct that the view is asking for numberOfChildren
before awakeFromNib was called.
You are right, but some applications depend on this behavior, and
eventually we may change it (it isn't a cut and dry thing to change).
Returning 0 base on your root object not being available is the
correct thing do to, and calling -reloadData inside awakeFromNib is a
good idea (but shouldn't be required).
4. A series of calls to outlineView:dataCellForTableColumn:item:
where tableColumn is passing in nil. I return nil.
It should call you once with nil, and once again with the tableColumn
non-nil, provided you returned nil the first time.
Unfortunately, there isn't enough info to really gather what is wrong.
I would suggest simplifying things to narrow down the problem. If you
think it is a bug in AppKit, please do log a bug report. Ideally, if
you can, include a sample application that reproduces the problem.
Things I suggest looking at:
1. Do you subclass NSTableView? If so, try removing that subclass.
2. Does it work if you remove the
outlineView:dataCellForTableColumn:item method entirely and use the
regular cell in the table column?
-corbin
If that is appropriate, how can I insure that I have valid data
before awakeFromNib is called?
If it matters, I'm running a 32bit build.
Thanks
On Aug 28, 2009, at 3:45 PM, Corbin Dunn wrote:
On Aug 28, 2009, at 11:58 AM, David Melgar wrote:
Running into a problem getting my application to run under Snow
Leopard.
In this case I have an outline view with a data source. The
method, outlineView:dataCellForTableColumn:item: is being repeated
called on my delegate with a null tableColumn, not just the first
time as the documentation states. The code returns different cells
based on the column, but its never passed the tableColumn.
I haven't heard of this problem. Try printing out all calls to the
method (include parameters), and printing out what you are
returning each time.
corbin
_______________________________________________
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