-
Notifications
You must be signed in to change notification settings - Fork 40
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
Big issue when receive memory warning and implement viewDidUnload #6
Comments
Not nearly enough detail. Closed for now. |
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. |
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:
|
Actually, I don't think that resolved the crasher either. |
hwhoops. Didn't see this:
Call this in |
This seems like it's still an open issue right? |
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? |
Looks like I don't remember my own code. :) I'll take a look at this when I get a chance. |
@maddox has the right approach. I put in |
I can't release pullView in viewDidUnload. App will CRASH if it receive memory warning.
The text was updated successfully, but these errors were encountered: