I have a problem in my apps that its memory increase constantly. So here is my app structure. I am using SWrevealViewController
for slidemenu.
Slidemenu
- View Controller A
- View Controller B
- View Controller C
My View Controller A consist of UICollectionView
and ScrollView
.
When I perform segue from View Controller A to View Controller B, the memory is doing fine. But if I am going to View Controller A with slide menu, the memory increases.
Here is my didSelectRowAtIndexPath
on SWRevealViewController's table delegate. I am using performSegueWithIdentifier
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
if isLoggedIn {
self.performSegueWithIdentifier(idSegueLoggedIn[indexPath.row], sender: self)
}
}
Then I am going to View Controller B via slide menu and then going to View Controller A again, on that point memory increases constantly.
It looks like my View Controller A that consist of UICollectionView
doesn't release its object on memory. But if I remove my UICollectionView
, my memory issue was dissapear and it runs well.
So I think it was about my reference to UICollectionView
. I already declared that with weak
property but it does nothing.
@IBOutlet weak var othersCollectionView: UICollectionView!
I try to called deinit() in my View Controlle A but it doesn't called.
Here is my memory usage graph, on each "black arrow", I move to View Controller A with slide menu.
Pls let me know if I am doing something wrong. Thank you so much.