BigCheesy
BigCheesy

Reputation: 1138

Best way to find retain cycle?

I have a nasty retain cycle in my iOS app. I'm looking at it in instruments and can see all of the retains/releases, but it's hard to track down exactly which retain is the one still holding on.

Does anyone have advice for finding exactly which retain is holding onto the reference?

Edit: Picture of the retain/releases:

Upvotes: 0

Views: 500

Answers (1)

Andrew
Andrew

Reputation: 3241

You could check out if instruments detects the leak, like so: enter image description here

From the looks of it, though, that timer near the end of the list doesn't get released. Could you update your post with the code in setVideoState ?

Edit:

What I usually do is try and match up the retain/releases (instruments should actually do that for you, i think it was some filter in the menu to the left), while focusing on my code, because the frameworks usually have their things together. In your case, as you go down that list you see that the timer has +1 but never get released after that.

Upvotes: 2

Related Questions