Avoid layout when providing cell values (fixes #73)
-tableView:objectValueForTableColumn:row: may call -layoutCandidateView, which in turn may force the table view to reload; the layout code should only run after all cell values are provided for to break this potential cycle.
This commit is contained in:
parent
d8203c2547
commit
54f0113c0c
|
@ -338,6 +338,12 @@ static const CGFloat kCandidateTextLeftMargin = 8.0;
|
|||
}
|
||||
|
||||
- (void)layoutCandidateView
|
||||
{
|
||||
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(deferredLayoutCandidateView) object:nil];
|
||||
[self performSelector:@selector(deferredLayoutCandidateView) withObject:nil afterDelay:0.0];
|
||||
}
|
||||
|
||||
- (void)deferredLayoutCandidateView
|
||||
{
|
||||
NSUInteger count = [_delegate candidateCountForController:self];
|
||||
if (!count) {
|
||||
|
|
Loading…
Reference in New Issue