Fix simple issue with ASTableViewStressTest, make Table / Collection handle changes to dataSource / delegate.

This commit is contained in:
Scott Goodson 2015-09-24 19:59:12 -07:00
parent d76c199368
commit ee4b771d5d
3 changed files with 4 additions and 5 deletions

View File

@ -234,7 +234,8 @@ static BOOL _isInterceptedSelector(SEL sel)
- (void)setDataSource:(id<UICollectionViewDataSource>)dataSource
{
ASDisplayNodeAssert(NO, @"ASCollectionView uses asyncDataSource, not UICollectionView's dataSource property.");
// UIKit can internally generate a call to this method upon changing the asyncDataSource; only assert for non-nil.
ASDisplayNodeAssert(dataSource == nil, @"ASCollectionView uses asyncDataSource, not UICollectionView's dataSource property.");
}
- (void)setDelegate:(id<UICollectionViewDelegate>)delegate

View File

@ -259,7 +259,8 @@ void ASPerformBlockWithoutAnimation(BOOL withoutAnimation, void (^block)()) {
- (void)setDataSource:(id<UITableViewDataSource>)dataSource
{
ASDisplayNodeAssert(NO, @"ASTableView uses asyncDataSource, not UITableView's dataSource property.");
// UIKit can internally generate a call to this method upon changing the asyncDataSource; only assert for non-nil.
ASDisplayNodeAssert(dataSource == nil, @"ASTableView uses asyncDataSource, not UITableView's dataSource property.");
}
- (void)setDelegate:(id<UITableViewDelegate>)delegate

View File

@ -100,9 +100,6 @@
- (void)thrashTableView
{
_tableView.asyncDelegate = self;
_tableView.asyncDataSource = self;
[_tableView reloadData];
NSArray *indexPathsAddedAndRemoved = nil;