Re: Error Message Bug in NSArrayController / NSTableView?
Re: Error Message Bug in NSArrayController / NSTableView?
- Subject: Re: Error Message Bug in NSArrayController / NSTableView?
- From: DumberThanDanQuayle <email@hidden>
- Date: Tue, 25 Jan 2005 19:06:41 -0500
I have just filed a bug report on this issue, tracking number: 3973437.
Summary:
The following error message is generate when an NSTableView otherwise properly connected to an NSArrayController:
2005-01-25 18:18:06.293 Bookmarks[1902] *** Illegal NSTableView data source (<DNDArrayController: 0x54ea70>[object class: NSMutableDictionary, number of selected objects: 0]). Must implement numberOfRowsInTableView: and tableView:objectValueForTableColumn:row:
Steps to Reproduce:
This warning message can easily be reproduced using M. Malcolm Crawford's "Bookmarks" example.
http://homepage.mac.com/mmalc/CocoaExamples/Bookmarks.zip
1.) Load the MyDocument.nib into InterfaceBuilder and cut the NSTableView.
2.) From the palette drag and expand an NSView, i.e. a "CustomView", where the NSTableView was.
3.) Paste the NSTableView into the NSView and reconnect all the objects as in the original version.
Expected Results:
No error message.
Actual Results:
The error message. Note, the NSTableView still functions as expected and properly with the NSArrayController acting as it's data source, despite the error message.
Workaround:
One work around would be to implement the "numberOfRowsInTableView: and tableView:objectValueForTableColumn:row:" methods as being demanded in the messages, either in NSArrayController itself via a category or in a subclass.
Isolation:
The isolation performed was reducing this problem to the insertation of the NSTableView to an NSView. Furthermore, it appears that this action somehow corrupts the nib file itself, as deleting the NSTableView, NSArrayController and the NSView, and then trying to restore the original state, i.e. with any NSView, fails as the error message still appears.
<x-tad-bigger>FROM : Mike Solomon
DATE : Wed Dec 22 12:11:00 2004
Hi all. I saw a conversation a couple of weeks earlier about using a
NSArrayController subclass as a dataSource to get drag and drop support
in an NSTableView.
I too get the following message:
2004-12-22 02:40:42.216 ******[27415] *** Illegal NSTableView data
source (<DTArrayController: 0x19221a0>[object class: NSString, number
of selected objects: 1]). Must implement numberOfRowsInTableView: and
tableView:objectValueForTableColumn:row:
(DTArrayController is a subclass of NSArrayController)
Now, the code basically works. The binding specified in the nib read
the correct data and the rows/columns are filled out correctly. I can
drag data into the table view and the appropriate code is called and
additions to the bound array are reflected in the UI.
As far as I can tell, everything is working correctly, yet I get this
message on the Console. The most unbelievable part is that I have
another table view in the same application that is working fine - no
error message. Clearly these messages don't need to be implemented. I
actually tried implementing them, to see if it was just a false alarm,
but implementing those messages prevents the data from the bindings
from showing up in the table.
Obviously, if I disconnect the dataSource in the nib, the error message
goes away, but so does drag and drop. The other instance works
perfectly fine. Maybe the haze of 3am is setting in, but I am
completely stumped.
The sample app Bookmarks from
</x-tad-bigger><x-tad-bigger>http://homepage.mac.com/mmalc/CocoaExamples/controllers.html</x-tad-bigger><x-tad-bigger> seems to
be doing the same thing, but after a quick download and compile, it
does not produce this error message...
Am I missing something completely obvious? Is this message safe to
ignore?
Any help would be most appreciated. Thanks all.
-Mike</x-tad-bigger> _______________________________________________
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden