Comments (9)
Not nearly enough detail. Closed for now.
from pulltorefreshview.
Just try to use your PullToRefreshView in viewDidLoad, and set to nil in viewDidUnload. Since PullToRefreshView is added as a observer of scrollView, while receiving memory warning, the scrollView is now being released. However, PullToRefreshView is still an observer of scrollView, which was just been released, now the app crash. This is the "Big Issue" that I can't release PullToRefreshView in viewDidUnload since the statements above.
from pulltorefreshview.
This is confirmed. Except it's 2 different issues.
I don't see it in the code, but somehow, the delegate is being retained. This is what causes the crash.
Setting the pullToRefreshView's delegate to nil before nillng out the pullToRefreshView does in fact prevent a crasher. But the issue with the observer is still present.
Here is the warning:
2012-01-27 22:02:02.317 GHTeam[10054:15803] Received memory warning.
2012-01-27 22:02:02.318 GHTeam[10054:15803] An instance 0x904a800 of class UITableView was
deallocated while key value observers were still registered with it. Observation info was
leaked, and may even become mistakenly attached to some other object. Set a breakpoint on
NSKVODeallocateBreak to stop here in the debugger. Here's the current observation info:
<NSKeyValueObservationInfo 0xa891080> (
<NSKeyValueObservance 0xa890d00: Observer: 0xa890ef0, Key path: contentOffset, Options: <New:
YES, Old: NO, Prior: NO> Context: 0x0, Property: 0xa891100>
)
from pulltorefreshview.
Actually, I don't think that resolved the crasher either.
from pulltorefreshview.
hwhoops. Didn't see this:
- (void)containingViewDidUnload;
Call this in viewDidUnload
and dealloc
and you're good to go.
from pulltorefreshview.
This seems like it's still an open issue right?
from pulltorefreshview.
I'm still not sure I understand. If you release your scroll view in -viewDidUnload, you should just release the pull to refresh view as well. Then it will remove its KVO context, and everything will be fine?
from pulltorefreshview.
Looks like I don't remember my own code. :) I'll take a look at this when I get a chance.
from pulltorefreshview.
@maddox has the right approach. I put in containingViewDidUnload
as a safe way to break the KVO/view retain cycle here. Itβs what Batch used to safely release the view.
from pulltorefreshview.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pulltorefreshview.