Collection view does not update

I have a tableview that feeds a detail view. The detail view includes a collection view. When I run the app and select a detail view from the table view, the collection view looks fine. But if I return to the tableview and select a different detail view, the detail view updates, but even though the images fed to the collection view are updated (checked by printing them in viewDidLoad), the images in the collection view are the previous images (determined by the inital choice of a detail view). So apparently I need to clean out the reuseable cells, but despite attempts to prepareForReuse and/or reloadData, I must not be doing this correctly. I'd appreciate suggestions about how to force the imageview in my collection view cell to recognize new images.

Replies

You should edit your post to make it easier to read.


I have a tableview that feeds a detail view. The detail view includes a collection view.

When I run the app and select a detail view from the table view, the collection view looks fine.

But if I return to the tableview and select a different detail view, the detail view updates, but even though the images fed to the collection view are updated (checked by printing them in viewDidLoad), the images in the collection view are the previous images (determined by the inital choice of a detail view).


So apparently I need to clean out the reuseable cells, but despite attempts to prepareForReuse and/or reloadData, I must not be doing this correctly. I'd appreciate suggestions about how to force the imageview in my collection view cell to recognize new images.


Waht do you mean:

I have a tableview that feeds a detail view.

Is it the detail button view ?


select a different detail view

Have you one or several detailview ?


And then post the code, that will be more useful for analysis than just a paraphrase of the code.


Waiting for this.