Skip to content
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

Can delete the finish animate. i find a KVO crash #47

Closed
Dcell opened this issue Nov 3, 2016 · 5 comments
Closed

Can delete the finish animate. i find a KVO crash #47

Dcell opened this issue Nov 3, 2016 · 5 comments

Comments

@Dcell
Copy link

Dcell commented Nov 3, 2016

if i fast exit viewController, it will KVO crash.

i find the finish animate, it's not a weak self.
ScrollView deinit, but PullerRefresh can't deinit. can't remove kvo.
then crash :(

@vvit
Copy link
Contributor

vvit commented Nov 23, 2016

@dingqili do you store your PullToRefresh instance in view controller ivars?

@Dcell
Copy link
Author

Dcell commented Nov 25, 2016

@vvit
Thanks for Help. I'm not store PullToRefresh in view controller.

1. It's my crash Info.

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x15fa1c800 of class UICollectionView was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x160a6d8d0> (
<NSKeyValueObservance 0x15f7d1a60: Observer: 0x160a48aa0, Key path: contentOffset, Options: <New: NO, Old: NO, Prior: NO> Context: 0x160a48b60, Property: 0x1609d4030>
<NSKeyValueObservance 0x160a60310: Observer: 0x160a48aa0, Key path: contentSize, Options: <New: NO, Old: NO, Prior: NO> Context: 0x160a48b60, Property: 0x160847b80>
<NSKeyValueObservance 0x160a5f4c0: Observer: 0x160a48aa0, Key path: contentInset, Options: <New: YES, Old: NO, Prior: NO> Context: 0x160a48b60, Property: 0x160848230>
)'
*** First throw call stack:
(0x180a7edb0 0x1800e3f80 0x180a7ecf8 0x1813d2d80 0x1800fdae8 0x18095c9fc 0x180a32bc0 0x18095cc50 0x182244088 0x185c46088 0x100224d24 0x1804fa8b8)
libc++abi.dylib: terminating with uncaught exception of type NSException

2.Debug Memory Graph

2016-11-25 15 11 22

It's not Deinit. Maybe cause of origin UIView.animate

3.WorkSpace

1.Xcode8.1
2.Object-c Project Use Swift FrameWork
3.IOS 9.3 , SDK >= 8.0
4.

       weak var controller = self;
       self.collectionView.addPullToRefresh(PullToRefresh()) { 
            controller?.refresh()
        }
        let bottomRefresh = PullToRefresh();
        bottomRefresh.position = .bottom;
        self.collectionView.addPullToRefresh(bottomRefresh) { 
            controller?.getMore()
        }
        self.collectionView.startRefreshing(at: .top)
    deinit {
        if self.isViewLoaded {
            self.collectionView.removePullToRefresh(self.collectionView.topPullToRefresh!)
            self.collectionView.removePullToRefresh(self.collectionView.bottomPullToRefresh!)
        }
    }

@gica-gugui
Copy link

+1 to this issue. However the crash happens only on iPhone 5 devices in my case (maybe this info is helpful).

@pmusolino
Copy link

Any news about this bug?

@srj0x0
Copy link

srj0x0 commented Nov 3, 2017

@codeido, @gica-gugui, try to remove PullerRefresh's from scroll view when your view controller is releasing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants