0

my app is crashing when I load the view second time. When app open it doesnt crash. If I click on my home menue when the app is opened it loads then after sometimes its crashing. These are the lines it shows the exception. enter image description here

enter image description here

enter image description here

What is the reason for this? in my console it shows atal error: unexpectedly found nil while unwrapping an Optional value. What is the reason for this? Please help me.Thanks

user1960169
  • 3,533
  • 12
  • 39
  • 61
  • 1
    The view "scrollMostWanted" is probably nil... you are not properly handling that optional. you can add "guard scrollMostWanted != nil else {return}" at the top of the function maybe. Or any other logic that works the best for you – Sajjon Jul 04 '16 at 16:28
  • I read it. I can't understand why its not crashing first time and why only crashing in second time? – user1960169 Jul 04 '16 at 16:28
  • Because it is not nil the first time... Are you removing the view? It is difficult to say based on your screenshots. It is better to submit the code :). – Sajjon Jul 04 '16 at 16:29
  • Thanks @Sajjon No I am not removing the view – user1960169 Jul 04 '16 at 16:33

0 Answers0