• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Data Source object for NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Wishing: NSLocalizedStringArray
      • From: Jerry Krinock <email@hidden>
    • Re: Data Source object for NSTableView
      • From: Ryan Bates <email@hidden>
    • Re: Data Source object for NSTableView
      • From: Allan Odgaard <email@hidden>
    • Re: Data Source object for NSTableView
      • From: Scott Anguish <email@hidden>
  • Prev by Date: [SOLVED]: NSFontManager's delegate.
  • Next by Date: Adding custom window widget to window
  • Previous by thread: Re: adding objects to mutable dictionary...
  • Next by thread: Re: Data Source object for NSTableView
  • Index(es):
    • Date
    • Thread