• 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
Re: NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView


  • Subject: Re: NSTableView
  • From: Larry Fransson <email@hidden>
  • Date: Wed, 1 Dec 2004 01:09:08 -0800


On Nov 30, 2004, at 23:05, Amit Kumar(R&D) wrote:
But how the compiler will recognize that which data source belongs to which table.

I see the misunderstanding now.

You can serve multiple table views with a single data source object. You only write each data source function once. What you return from the function depends on which table view is asking for the data.

Consider a data source function like -numberOfRowsInTableView:. Note that the signature is - (int)numberOfRowsInTableView(NSTableView *)aTableView. The parameter "aTableView" is a pointer to the table view that needs to know how many rows are in the view. You write the code necessary to determine how many rows are in that particular table view, something like

if(aTableView == firstTableView) {
return thisInt;
}
if((aTableView == secondTableView) {
return thatInt;
}

Larry Fransson
Seattle, WA
 _______________________________________________
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

  • Prev by Date: Re: Off-screen Printing
  • Next by Date: Re: Swapping isa's (was Re: Hex Edit controls (resknife))
  • Previous by thread: RE: Strangeness when moving data through an array.
  • Next by thread: Custom menu drawing / NSPopupButtonCell question
  • Index(es):
    • Date
    • Thread