• 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 and DataSource problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView and DataSource problem


  • Subject: Re: NSTableView and DataSource problem
  • From: Graham Cox <email@hidden>
  • Date: Sat, 7 Feb 2009 02:15:06 +1100


On 7 Feb 2009, at 2:10 am, Valentin Dan wrote:

Anyway, what's the proper method for updating the data for the list ? I
need to change all the data.




Currently I'm setting the tableView's data source to "nil", I'm
releasing the old dataSource, creating a new one (with the new items)
then setting a the table's dataSource to the new one... is that close ?
:-)


Not even.

The datasource is a fairly passive entity, sitting waiting to be asked by the table to give it content. If the data changes you simply call [table reloadData]; and the datasource will be called again as needed to return the new data.

Swapping out the datasource is never needed.

--Graham


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSTableView and DataSource problem
      • From: Graham Cox <email@hidden>
References: 
 >NSTableView and DataSource problem (From: "Valentin Dan" <email@hidden>)

  • Prev by Date: Warning 'could not find object file' on NSAppleScript -executeAndReturnError
  • Next by Date: Re: NSTableView and DataSource problem
  • Previous by thread: NSTableView and DataSource problem
  • Next by thread: Re: NSTableView and DataSource problem
  • Index(es):
    • Date
    • Thread