• 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: How to set a default row in NSTableView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to set a default row in NSTableView?


  • Subject: Re: How to set a default row in NSTableView?
  • From: Andy Lee <email@hidden>
  • Date: Tue, 21 Jun 2005 22:49:37 -0400

On Jun 21, 2005, at 9:23 PM, Mark Dawson wrote:
My main problem/issue is knowing WHEN my data source is populated.

It sounds like you're imagining that the table view gets "loaded up" with data. That's not how it works. The only thing the table view "holds on to" is the connection to the data source. It asks the data source for bits of information only on an as-needed basis when the time comes to display itself. For example, the table view doesn't call -tableView:objectValueForTableColumn:row: for every single cell -- only the ones it needs to display. And it doesn't maintain its own array of cell values; rather, it asks the data source for cell values one by one, and only holds on to each cell value long enough to display it.


The only thing you probably need to do in your -awakeFromNib is call either -noteNumberOfRowsChanged or -reloadData, to make sure the table view knows the data source may have a different number of rows and/or cell values than the last time it checked. Then you can select whatever rows you want.

--Andy

_______________________________________________
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


  • Follow-Ups:
    • Re: How to set a default row in NSTableView?
      • From: Mark Dawson <email@hidden>
References: 
 >Re: How to set a default row in NSTableView? (From: Ben Kazez <email@hidden>)
 >Re: How to set a default row in NSTableView? (From: Mark Dawson <email@hidden>)
 >Re: How to set a default row in NSTableView? (From: j o a r <email@hidden>)
 >Re: How to set a default row in NSTableView? (From: Mark Dawson <email@hidden>)

  • Prev by Date: Re: Confused by Apple's DragNDropOutlineView example
  • Next by Date: NSTreeController and Core Data: creating abstract entities?
  • Previous by thread: Re: How to set a default row in NSTableView?
  • Next by thread: Re: How to set a default row in NSTableView?
  • Index(es):
    • Date
    • Thread