TextureGroup / Texture

Smooth asynchronous user interfaces for iOS apps.
https://texturegroup.org/
Other
8.02k stars 1.29k forks source link

Zombie _ASTableViewCell Issue after deleteRows #1407

Open GeekTree0101 opened 5 years ago

GeekTree0101 commented 5 years ago

스크린샷 2019-03-15 오후 3 25 39

related with https://github.com/GeekTree0101/VEditorKit/issues/57

<_ASTableViewCell: 0x1420c1e00; baseClass = UITableViewCell; frame = (0 1501; 414 342); clipsToBounds = YES; autoresize = W; tintColor = UIExtendedSRGBColorSpace 0 0.478 1 1; layer = <CALayer: 0x2814c9080>>

Printing description of $30:
<ASTableView: 0x14283c800; baseClass = UITableView; frame = (0 64; 414 446); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x281ab5fe0>; layer = <ASTableNode-Layer: 0x281ab6040; node = <ASTableNode: 0x14201a200>>; contentOffset: {0, 347.33333333333331}; contentSize: {414, 706}; adjustedContentInset: {0, 0, 59.666666666666664, 0}>
GeekTree0101 commented 5 years ago

스크린샷 2019-03-15 오후 3 34 17

GeekTree0101 commented 5 years ago

In my case, i solved this issue

        self.tableNode.performBatchUpdates({
// remove rows
            self.tableNode.deleteRows(at: [ ...... ],
                                      with: animated ? .automatic: .none)
        }, completion: { _ in
            _ = self.tableNode.view.subviews
                .filter({ $0 is UITableViewCell })
                .filter { $0.subviews.first?.subviews.isEmpty ?? false ||
                    $0.subviews.first?.subviews.first is UIImageView }
                .map { $0.removeFromSuperview() }
        })
lohenyumnam commented 5 years ago

Hey is that storyboard using with Texture ??

GeekTree0101 commented 5 years ago

Nope i didn't use storayboard :)

GeekTree0101 commented 5 years ago
(lldb) po self.tableNode.visibleNodes
<__NSCFArray 0x282f7ef10>(
<VEditorKit.VEditorTextCellNode: 0x103856200; frameInWindow = (0 -473.667; 414 1150); viewController = <VEditorKit_Example.EditorNodeController: 0x102c11680>; alpha = 1; frame = (0 0; 414 1150); interfaceState = { MeasureLayout | Preload | Display | Visible }; view = <_ASDisplayView: 0x102b2a400>; indexPath = (0, 0); tableNode = <ASTableNode: 0x103035600>>,
<VEditorKit.VEditorTextCellNode: 0x103099200; frameInWindow = (0 346.333; 414 83); viewController = <VEditorKit_Example.EditorNodeController: 0x102c11680>; alpha = 1; frame = (0 0; 414 83); interfaceState = { MeasureLayout | Preload | Display }; view = <_ASDisplayView: 0x102c79220>; tableNode = <ASTableNode: 0x103035600>>
)

(lldb) po [[self.tableNode.visibleNodes objectAtIndex:0] indexPath]
<NSIndexPath: 0xdb246ae24437396a> {length = 2, path = 0 - 0}

(lldb) po [[self.tableNode.visibleNodes objectAtIndex:1] indexPath]
 nil
(lldb)