jeudi 5 mars 2015

AFNetworking UIProgress view in Table Cell causes dealloc when the tableviewcontroller is navigated from

I have been implementing background uploads and downloads and using AFNetworking to handle the tasks.


Part of this is that I have a tableview that shows the current state of filetransfers.


When I create the tableview cell I add a UIProgressView (from the AFNetworking Category) to the cell.


I then assign the task for it to track the progress of like below.



[taskProgressView setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)self.task animated:YES];


However when I navigate away from the View controller that has the tableview, I get the following issue.


*** -[UIProgressView retain]: message sent to deallocated instance 0x65a6cced0


In the code I have tried to dealloc everything I can, setup reuse of cells, and remove any notification observers I have. However this still happens.


The only way I have managed to stop this is to not assign the task to the UIProgressView.


You can find the Category for the UIProgressView (AFNetworking here)


http://ift.tt/1GYA8c2


My assumption is that in there something is still retaining a reference to the progress view and not releasing it correctly.


Any suggestions of what to try next are appreciated.




Aucun commentaire:

Enregistrer un commentaire