• 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: Changing NSTableView DataSource without glitching
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing NSTableView DataSource without glitching


  • Subject: Re: Changing NSTableView DataSource without glitching
  • From: Corbin Dunn <email@hidden>
  • Date: Wed, 15 Mar 2006 17:53:54 -0800


The solution I have found is to set the DataSource to nil, make my changes,
and then "reconnect" it and finally -reloadData...


[myTableView setDataSource:nil] ;
[self setArrayFromWhichDataIsTaken:newArray] ;
[myTableView setDataSource:self] ;
[myTableView setDelegate:self] ;
[myTableView reloadData] ;

This makes sense heuristically and has been proven experimentally and in the
field. But can anyone explain this based on Cocoa documentation?

You don't have to do this. Calling reloadData is enough. Chances are, your method call to setArrayFromWhichDataIsTaken: is allowing some events to be processed. You should be able to stick breakpoints on the datasource events and see the callstack for when they are called and find out what is wrong.


--corbin
_______________________________________________
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: 
 >Changing NSTableView DataSource without glitching (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Changing NSTableView DataSource without glitching
  • Next by Date: Re: Maximum simultaneous NSURLConnections?
  • Previous by thread: Changing NSTableView DataSource without glitching
  • Next by thread: Re: Changing NSTableView DataSource without glitching
  • Index(es):
    • Date
    • Thread