Re: Changing NSTableView DataSource without glitching
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