-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Node should always be marked invisible before deallocating #145
Comments
From @hannahmbanana on October 7, 2016 7:8 @Dominionys: It's odd that this has regressed between 1.9.81 and 1.9.90. A few questions:
|
From @hannahmbanana on November 15, 2016 4:8 @Dominionys - Are you still seeing this issue? I'm going to close this issue given the length of time since the thread was active. Feel free to re-open the issue if you are still having this issue. |
From @nhatlee on November 25, 2016 10:36 I still got the same crash on SDK version beta 2. |
From @hannahmbanana on November 27, 2016 21:8 @nhatlee - thank you for reporting! Is this issue 100% reproducible for you? Would it be possible for you to include a sample project here or emailed to asyncdisplaykit@gmail.com? |
From @tomizimobile on November 29, 2016 20:32 @hannahmbanana @Adlai-Holler I've also come across this issue. I found it in a specific view controller of mine, and I think having a non-translucent tabBar might be part of the issue (at least for me). Using aa9dff0. Just run the sample project and hit the reload button without scrolling. Seems to be happening across a variety of simulators, tried it on 5S, 6S and 6S+ |
From @Adlai-Holler on November 30, 2016 17:1 @tomizimobile Thanks for an excellent repro! I turned it into a unit test case and resolved the issue in the linked PR. Could you and @nhatlee verify that the issue is fixed? |
From @tomizimobile on November 30, 2016 19:15 @Adlai-Holler I'm still seeing the issue in my current project. I've been trying to recreate it in a separate project but haven't been able to reproduce it there so far. |
From @tomizimobile on November 30, 2016 19:45 @Adlai-Holler alright, finally tracked it down. Seemed to be ok with a grouped tableView, but this is happening with a plain tableView. |
From @stephenkopylov on February 6, 2017 16:33 Have the same issue with plain tv + section header views. ASDK v2.0.2 |
From @9you on April 28, 2017 9:3 I still facing this problem on |
I seem to have exactly the same problem with AsyncDisplayKit (2.2.1)
|
Bump! I have similar assert on tableView when moving cells (sometimes). I didn't have this issue on earlier versions as I recall. Basically, I have very simple tablenode in editing mode, with scroll disabled, where one cell isn't move'able (movable?) and need to be at last index. Stack:
code: #pragma mark - TableNode
- (ASSizeRange)tableView:(ASTableView *)tableView constrainedSizeForRowAtIndexPath:(NSIndexPath *)indexPath
{
return ASSizeRangeMake(CGSizeMake(self.scrollNode.tableNode.style.preferredSize.width, 70));
}
- (ASCellNode *)tableView:(ASTableView *)tableView nodeForRowAtIndexPath:(NSIndexPath *)indexPath
{
UIFont *font = [UIFont systemFontOfSize:22 weight:UIFontWeightSemibold];
UIColor *textColor = [UIColor whiteColor];
NSDictionary *attributes = @{NSForegroundColorAttributeName: textColor, NSFontAttributeName: font};
UIEdgeInsets insets = UIEdgeInsetsMake(INFINITY, 15, INFINITY, 15);
BackgroundScreenNameCellNode *textCellNode = [[BackgroundScreenNameCellNode alloc] initWithAttributes:attributes insets:insets];
BackgroundScreenType screen = [[GVUserDefaults standardUserDefaults] screenForIndex:indexPath.row];
if (screen == BackgroundScreenSettings) {
textCellNode.separatorInset = UIEdgeInsetsMake(INFINITY, INFINITY, INFINITY, 0);
} else {
textCellNode.separatorInset = UIEdgeInsetsMake(INFINITY, 15, INFINITY, 0);
}
textCellNode.text = [NSString stringForBackgroundScreenType:screen];
textCellNode.screen = screen;
textCellNode.backgroundColor = [UIColor clearColor];
textCellNode.selectionStyle = UITableViewCellSelectionStyleNone;
return textCellNode;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [GVUserDefaults standardUserDefaults].screensOrder.count;
}
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
return UITableViewCellEditingStyleNone;
}
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
{
BackgroundScreenType screen = [[GVUserDefaults standardUserDefaults] screenForIndex:indexPath.row];
if (screen != BackgroundScreenSettings) {
return YES;
}
return NO;
}
- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath
{
return NO;
}
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath
{
if (sourceIndexPath.row == destinationIndexPath.row) {
return;
}
NSMutableArray *screensOrder = [[GVUserDefaults standardUserDefaults].screensOrder mutableCopy];
BackgroundScreenType screen = [[GVUserDefaults standardUserDefaults] screenForIndex:sourceIndexPath.row];
[screensOrder removeObjectAtIndex:sourceIndexPath.row];
[screensOrder insertObject:@(screen) atIndex:destinationIndexPath.row];
[GVUserDefaults standardUserDefaults].screensOrder = screensOrder;
[[NSNotificationCenter defaultCenter] postNotificationName:kScreensOrderDidChanged object:nil userInfo:@{kScreensOrderDidChanged : @0}];//0 gdyż jesteśmy w Ustawieniach
}
- (NSIndexPath *)tableView:(UITableView *)tableView targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath *)sourceIndexPath toProposedIndexPath:(NSIndexPath *)proposedDestinationIndexPath
{
if (proposedDestinationIndexPath.row == [GVUserDefaults standardUserDefaults].screensOrder.count - 1) {
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:([GVUserDefaults standardUserDefaults].screensOrder.count - 2) inSection:proposedDestinationIndexPath.section];
return indexPath;
} else {
return proposedDestinationIndexPath;
}
} |
@nguyenhuy @Adlai-Holler although prior manifestations of this issue have occurred, I believe as of the current versions of Texture, the primary issue is the recently-added visibleMap codepath. It's not clear that we are iterating over the items to ensure they are marked invisible. It may actually be a sufficient fix to keep the map retained for an additional period of time, until removed-from-hierarchy notifications occur. Or, perhaps these are ignored when in the RangeManaged hierarchy state? |
I wish I had more time to address this right now, it's very important to me, but here are some notes for the time being.
|
For apps that include pre-existing calls to reloadData, this assertion has made development difficult on all recent versions of Texture. Since triggering it can't be reliably used as signal by the app developer, and halts a development session (sometimes immediately on app start), it should be disabled until it is reliable again. See issue #145 for details.
…is addressed. (TextureGroup#313) [ASDisplayNode] Revise assertion to log until Issue TextureGroup#145 is addressed. #trivial
This was indeed resolved by having the range controller retain visible nodes (replacing the weak set as my last comment mentioned.) |
From @Dominionys on September 15, 2016 11:39
AsyncDisplayKit version - '1.9.90'
'1.9.81' works fine.
Hi, can you help me with it? I have a ASTableNode on ViewController (not AS). For example i have 5 section with random number of rows, and if i will scroll table to bottom then to top and reloadSection (for example) 3 section (not on the screen), everything is good. But if i didn't scroll and reload table, app will crash. All nodes are layerBacked = false.
Reload section:
self?.tableViewCompany.tableNode.view.reloadSections(indexSet, withRowAnimation: UITableViewRowAnimation.Fade)
Cell example:`
class CompanyCellNodeItem: AbstractNodeCell {
`
Trace log:
2016-09-15 18:35:10.694 Prestige[3690:1807714] *** Assertion failure in -[Prestige.CompanyNodeNew dealloc], /Users/Unfeeling/XcodeProjects/Pods/AsyncDisplayKit/AsyncDisplayKit/ASDisplayNode.mm:382 2016-09-15 18:35:10.700 Prestige[3690:1807714] *** Assertion failure in -[ASImageNode dealloc], /Users/Unfeeling/XcodeProjects/Pods/AsyncDisplayKit/AsyncDisplayKit/ASDisplayNode.mm:382 2016-09-15 18:35:10.703 target[3690:1807714] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Node should always be marked invisible before deallocating; interfaceState: 15, <ASImageNode: 0x173da200>' *** First throw call stack: (0x254e391b 0x24c7ee17 0x254e37f1 0x25cc7529 0xb3977d 0xb72415 0xb1dcd9 0xacb3bb 0xac8da3 0x29d617d1 0x29a5621b 0x29a591b5 0xb56251 0x24c7df55 0x24c87ddf 0x24c87e03 0xb39ab9 0xb1dcd9 0x253fad99 0x24c98f67 0x253fad99 0x24c98f67 0x24c993a9 0x253f2f89 0x254a406f 0x253f3229 0x253f3015 0x269e3ac9 0x29ac5189 0x3d2770 0x2509b873) libc++abi.dylib: terminating with uncaught exception of type NSException
Copied from original issue: facebookarchive/AsyncDisplayKit#2252
The text was updated successfully, but these errors were encountered: