Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions AsyncDisplayKit/ASCollectionView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ - (instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionVi
{
if (!(self = [super initWithFrame:frame collectionViewLayout:layout]))
return nil;

// FIXME: asyncDataFetching is currently unreliable for some use cases.
// https://github.com/facebook/AsyncDisplayKit/issues/385
asyncDataFetchingEnabled = NO;

ASDisplayNodeAssert([layout isKindOfClass:UICollectionViewFlowLayout.class], @"only flow layouts are currently supported");

Expand Down Expand Up @@ -165,8 +169,10 @@ - (instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionVi
return self;
}

-(void)dealloc {
// a little defense move here.
- (void)dealloc
{
// Sometimes the UIKit classes can call back to their delegate even during deallocation.
// This bug might be iOS 7-specific.
super.delegate = nil;
super.dataSource = nil;
}
Expand Down
16 changes: 12 additions & 4 deletions AsyncDisplayKit/ASTableView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ void ASPerformBlockWithoutAnimation(BOOL withoutAnimation, void (^block)()) {
#pragma mark -
#pragma mark Lifecycle

- (void)configureWithAsyncDataFetching:(BOOL)asyncDataFetchingEnabled {
- (void)configureWithAsyncDataFetching:(BOOL)asyncDataFetchingEnabled
{
_layoutController = [[ASFlowLayoutController alloc] initWithScrollOption:ASFlowLayoutDirectionVertical];

_rangeController = [[ASRangeController alloc] init];
Expand Down Expand Up @@ -185,12 +186,17 @@ - (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style asyncD
if (!(self = [super initWithFrame:frame style:style]))
return nil;

// FIXME: asyncDataFetching is currently unreliable for some use cases.
// https://github.com/facebook/AsyncDisplayKit/issues/385
asyncDataFetchingEnabled = NO;

[self configureWithAsyncDataFetching:asyncDataFetchingEnabled];

return self;
}

- (instancetype)initWithCoder:(NSCoder *)aDecoder {
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
if (!(self = [super initWithCoder:aDecoder]))
return nil;

Expand All @@ -199,8 +205,10 @@ - (instancetype)initWithCoder:(NSCoder *)aDecoder {
return self;
}

-(void)dealloc {
// a little defense move here.
- (void)dealloc
{
// Sometimes the UIKit classes can call back to their delegate even during deallocation.
// This bug might be iOS 7-specific.
super.delegate = nil;
super.dataSource = nil;
}
Expand Down