GMGridView never gets deallocated because of a retain cycle with GMGridViewCell.
If you repeatedly push/pop it with a UINavigationController it will never dealloc and the memory usage increases as more GMGridView (and related) objects get alloced.
It's due to a reference to self in the cell.deleteBlock in newItemSubViewForPosition:. Updating to weakSelf fixes it.
So happy to have this resolved...
Fixed memory leak. GMGridView never gets dealloced because of retain …
…cycle with GMGridViewCell.
Good catch! Thank you.
您好！请问我将一个view赋给cell.contentView (cell.contentView = aView),我的View上有个button，但是当我点击button时，并没有响应?
this has not worked for me...suggest some way to fix this issue
not working for me. I've have the same problem. I put in each cell, a UIImageView, but when i repeatedly push/pop it from UiNavigationController, memory remain allocated.
I'm not able to reproduce the issue using the latest GMGridView code using ARC with iOS 4.3 and iOS 5.
I created a sample project that you can use as a starting point to isolate the issue. It's a simple UINavigationController that pushes/pops one of the view controllers from the GMGridView example project:
Here's what I recommend:
Hope that helps.
i've tried your project and work perfectly. in my project, after that i pop uiviewcontroller, the GMGridView and his Cell grid remain in memory. The ARC does not even use, because it is a project started long ago and very large. could be the problem?
Thanks for the nice sample project @soleares
@majinbigor , yeah it's probably your project that is not ARC enabled. Try this in Xcode (before adding the grid classes) : Edit > Refactor > Convert to Objective C ARC.
Is this still a bug in devel? We really should remove this branch and just use main, it's way to confusing otherwise.