Data Source object for NSTableView
Data Source object for NSTableView
- Subject: Data Source object for NSTableView
- From: Jerry Krinock <email@hidden>
- Date: Thu, 19 Feb 2004 22:38:13 -0800
I understand that an NSTableView needs a Data Source object which responds
to what I'd call certain "callback" messages to synchronize the data, and
that this object normally has as one member an NSArray which is the "guts"
of the data.
Where do I instantiate this Data Source? The target NSTableView is in a
"window nib" file. The File Owner of this nib is a subclass of
NSWindowController. I tried instantiating my Data Source as another "blue
box" in Interface Builder, and also declaring it and creating it in my code.
This had the odd result of creating one Data Source object in my code, and
another Data Source object when showWindow: did its thing in the nib. (Yes,
I had loads of fun trying to figure out why changes in the object's data
seemed to not "stick".)
I believe I remember reading somewhere that the File Owner was the only
thing in the nib which was actually "connected" to the code, so it is not
instantiated when the nib loads, but all other objects are. This explains
the odd behavior to me.
I'm thinking of wiping out my Data Source object, and incorporating all its
methods and data into the File Owner, my subclassed NSWindowController. Is
that the correct way to do it? If not, what object type should it be a
subclass of?
THANKS
Jerry Krinock
San Jose, CA USA
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.