0

I am creating a social media app and have a collection view to display each image that the user posts. I am having a problem reloading the collection view so that it will display the images immediately after a post. Currently, images will be displayed when the user signs out and then signs back in.

I have been using this code to reload my UICollectionView:

self.collectionView.reloadData()

However, no matter where I place that line of code in my project I return the error:

"Thread 1: EXC_BAD_INSTRUCTION"

and in some places it also returns:

"fatal error: unexpectedly found nil while unwrapping an optional value"

Does anyone have an idea on why this may be happening? Any help would greatly be appreciated.

shim
  • 9,289
  • 12
  • 69
  • 108
  • 1
    Add the exception breakpoint to get more information and the line where the error occurs and read [what does fatal error unexpectedly found nil while unwrapping an optional value mean?](http://stackoverflow.com/questions/32170456/what-does-fatal-error-unexpectedly-found-nil-while-unwrapping-an-optional-valu). There could be many reasons – vadian May 18 '17 at 13:19
  • Pls share delegate and datasource methods – Jitendra Tanwar May 18 '17 at 17:28

0 Answers0