samvermette / SVPullToRefresh

Give pull-to-refresh & infinite scrolling to any UIScrollView with 1 line of code.
http://samvermette.com/314
MIT License
4.82k stars 1.09k forks source link

iOS10 - showsInfiniteScrolling = YES - Observers issue #294

Open spizzico7 opened 8 years ago

spizzico7 commented 8 years ago

Hi, i'm using the showInfiniteScrolling property set as YES. Removing the viewcontroller with infinite table view i receive this error:

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x110024c00 of class UITableView was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x17002e8c0> ( <NSKeyValueObservance 0x174252c60: Observer: 0x0, Key path: contentOffset, Options: <New: YES, Old: NO, Prior: NO> Context: 0x0, Property: 0x174252300> <NSKeyValueObservance 0x174254910: Observer: 0x0, Key path: contentSize, Options: <New: YES, Old: NO, Prior: NO> Context: 0x0, Property: 0x174254940> )' First throw call stack: (0x190d821c0 0x18f7bc55c 0x190d82108 0x1917d2d64 0x196d615cc 0x196dcee08 0x1001fd948 0x18fc62a28 0x1001f0bf4 0x18fc62a28 0x10014cac4 0x10014b594 0x1001f074c 0x1001fd22c 0x1001fadf8 0x196bdd0b0 0x196bdcc78 0x1975a641c 0x19739dd84 0x19739db8c 0x19739de5c 0x196bdcef4 0x196bdcc78 0x100194390 0x100190d1c 0x196bda0e8 0x19409a188 0x19408ee64 0x19408ed24 0x19400b7ec 0x194032c58 0x194033678 0x190d2f7dc 0x190d2d40c 0x190d2d89c 0x190c5c048 0x1926e2198 0x196c482fc 0x196c43034 0x1001d6714 0x18fc405b8) libc++abi.dylib: terminating with uncaught exception of type NSException

Setting showsInfiniteScrolling to ->NO the error is not visibile and the app doesn't crash.

Can u help me?

edalford11 commented 7 years ago

This is happening a lot in my app as well with this library.