• 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: Mark Dawson <email@hidden>
  • Date: Wed, 22 Jun 2005 18:51:05 -0700

After playing around a little, it looks like all I need to do is call the -selectRowIndexes from my awakeFromNib. I don't have to call reloadData, because nothing has been loaded yet (so the first loads include the selected data)…

thanks for all of your help!

Mark

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:
email@hidden


This email sent to email@hidden


_______________________________________________ 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
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>)
 >Re: How to set a default row in NSTableView? (From: Andy Lee <email@hidden>)

  • Prev by Date: Re: Relying on shell tools to be installed? Where do you find this out?
  • Next by Date: NSImage copy from custom view
  • 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