Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit 8b3f335

Browse files
author
Scott Goodson
committed
Logging for test failures that are only occurring on build server with iOS 8.1 simulator...
1 parent ca57059 commit 8b3f335

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

AsyncDisplayKit/ASCollectionView.mm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,10 @@ - (void)dealloc
184184
{
185185
// Sometimes the UIKit classes can call back to their delegate even during deallocation, due to animation completion blocks etc.
186186
_isDeallocating = YES;
187+
NSLog(@"before dealloc - delegate - %@, datasource - %@, proxyDelegate - %@, proxyDatasource - %@", self.asyncDelegate, self.asyncDataSource, _proxyDelegate, _proxyDataSource);
187188
[self setAsyncDelegate:nil];
188189
[self setAsyncDataSource:nil];
190+
NSLog(@"after dealloc - delegate - %@, datasource - %@, proxyDelegate - %@, proxyDatasource - %@", self.asyncDelegate, self.asyncDataSource, _proxyDelegate, _proxyDataSource);
189191
}
190192

191193
/**
@@ -267,6 +269,8 @@ - (void)setAsyncDataSource:(id<ASCollectionViewDataSource>)asyncDataSource
267269
_asyncDataSourceImplementsConstrainedSizeForNode = ([_asyncDataSource respondsToSelector:@selector(collectionView:constrainedSizeForNodeAtIndexPath:)] ? 1 : 0);
268270
}
269271

272+
NSLog(@"setAsyncDataSource - %@, proxy - %@, deallocating - %d", asyncDataSource, _proxyDataSource, _isDeallocating);
273+
270274
super.dataSource = (id<UICollectionViewDataSource>)_proxyDataSource;
271275
}
272276

@@ -292,6 +296,8 @@ - (void)setAsyncDelegate:(id<ASCollectionViewDelegate>)asyncDelegate
292296
_asyncDelegateImplementsInsetSection = ([_asyncDelegate respondsToSelector:@selector(collectionView:layout:insetForSectionAtIndex:)] ? 1 : 0);
293297
}
294298

299+
NSLog(@"setAsyncDelegate - %@, proxy - %@, deallocating - %d", asyncDelegate, _proxyDelegate, _isDeallocating);
300+
295301
super.delegate = (id<UICollectionViewDelegate>)_proxyDelegate;
296302

297303
[_layoutInspector didChangeCollectionViewDelegate:asyncDelegate];

AsyncDisplayKit/Details/ASDelegateProxy.m

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,8 @@ - (instancetype)initWithTarget:(id <NSObject>)target interceptor:(id <ASDelegate
8282

8383
- (BOOL)respondsToSelector:(SEL)aSelector
8484
{
85-
ASDisplayNodeAssert(_interceptor, @"interceptor must not be nil");
86-
8785
if ([self interceptsSelector:aSelector]) {
88-
return YES;
86+
return (_interceptor != nil);
8987
} else {
9088
// Also return NO if _target has become nil due to zeroing weak reference (or placeholder initialization).
9189
return [_target respondsToSelector:aSelector];
@@ -94,8 +92,6 @@ - (BOOL)respondsToSelector:(SEL)aSelector
9492

9593
- (id)forwardingTargetForSelector:(SEL)aSelector
9694
{
97-
ASDisplayNodeAssert(_interceptor, @"interceptor must not be nil");
98-
9995
if ([self interceptsSelector:aSelector]) {
10096
return _interceptor;
10197
} else {

0 commit comments

Comments
 (0)