I ported some old code over to Objective-C ARC (Automatic Reference Counting) and it seems to work great. Except a rather large, high-level object is not being deallocated when it is popped off of my navigation stack, making me believe I have a retain cycle somewhere that ARC has hidden from me (or at least made difficult to track down). What is the best way to weed out this potential retain cycle and/or what is a good way to determine the cause of a memory leak under ARC? Thanks!
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Xcode: Is there a way to change line spacing (UI L
- Unable to process app at this time due to a genera
The best way is usually to use the Leaks instrument in the Instruments app.
The What's New In Instruments video from WWDC 2011 discusses using Instruments to find retain cycles under ARC, starting about 38 minutes in.
X-code 8 introduced the Memory graph debugging tool:
have a look here for full reference:
https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/debugging_with_xcode/chapters/special_debugging_workflows.html#//apple_ref/doc/uid/TP40015022-CH9-DontLinkElementID_1
I just transitioned an older app to use ARC. Instruments showed no leaks, but the allocations continued to go up. I found that by looking at the live objects for something that I knew should be deleted, I was able to track down the retains without a release. Here are the basic steps: