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

Question about where to put reactive code. #24

Closed
danielt1263 opened this issue May 28, 2015 · 3 comments
Closed

Question about where to put reactive code. #24

danielt1263 opened this issue May 28, 2015 · 3 comments
Labels

Comments

@danielt1263
Copy link
Collaborator

I currently have my reactive code in the viewDidLoad method, and I dispose everything in the deinit.

However, I noticed that when I exit my view controller, the deinit is never called. I confirmed that the view controller is not getting reused, and that my memory footprint goes up with every entry/exit of my view controller, but no leaks are detected...

Does anybody know what is going on?

@manumax
Copy link

manumax commented May 28, 2015

Are you running instruments against simulator or a real device to check memory footprint? If the answer is simulator, try again using a real device.
About deinit never called, have you checked for reference cycles? They won't show as memory leaks (since they aren't). Another thing you could do, it's to consider using viewWillAppear and viewDidAppear to create and dispose your reactive code.

@kzaher
Copy link
Member

kzaher commented May 28, 2015

Hi @DTartaglia, leaks profiler in Xcode is useless. Apple has made a small dirty marketing trick there :)

If you use allocations profiler, you should see number of view controller objects in memory.

Unfortunately, Apple has bug with profiling allocations on simulator, so you'll need to run profiler on real device, otherwise it won't show instances of some of your objects :(

@manumax is right, you have retain cycle somewhere.

We can probably discuss things like that in slack, because otherwise we'll spam whoever is watching this repository :)

@danielt1263
Copy link
Collaborator Author

FYI. I found the retain cycle and fixed it.

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

No branches or pull requests

3 participants