TNImageSliderViewController icon indicating copy to clipboard operation
TNImageSliderViewController copied to clipboard

fatal error: unexpectedly found nil while unwrapping an Optional value

Open tecexpert opened this issue 9 years ago • 3 comments

Error in this line:

// 1. Set the image array with UIImage objects
imageSliderVC.images = [image1, image2, image3]

There is my po Log

(lldb) po image1
<UIImage: 0x7fe643d1f2c0>, {320, 152}

(lldb) po image2
<UIImage: 0x7fe643d21590>, {320, 152}

(lldb) po image3
<UIImage: 0x7fe643d21e10>, {320, 152}

tecexpert avatar Mar 03 '16 10:03 tecexpert

I have the same problem

Eder87rh avatar Mar 05 '16 16:03 Eder87rh

Any solution to this? I'm having the same issue!

2113industries avatar Apr 03 '16 05:04 2113industries

Are you sure the view controller has already been loaded? When the image property is set, the collectionview's reloadData method is called. It could be that the collectionview hasn't been created yet.

Only set the images property, after the viewDidLoad has been called (at that point all UI elements have been created).

frederik-jacques avatar Apr 05 '16 15:04 frederik-jacques