fatal error: unexpectedly found nil while unwrapping an Optional value?

0 votes
550 views
asked Nov 25, 2014 in Swift by kalpana (3,995 points)
edited Nov 25, 2014 by kalpana

Hi

   I am getting the following error while assinging the value to UIlabel in custom UICOollectioncell..

Error

fatal error: unexpectedly found nil while unwrapping an Optional value

Code 

   @IBOutlet var feedContentSnippet: UILabel!

func initValue(labelValue:String){

        feedContentSnippet.text = labelValue;

    }

1 Answer

0 votes
answered Nov 25, 2014 by john (4,220 points)

HI

 UICollectionViewCell inside StoryBoard don't need to registerClass, just choose reuseidentifier in StoryBoard. Delete this line:

   // [self.workoutView registerClass:[Cell class] forCellWithReuseIdentifier:@"Cell"];

And make sure you connect right way;

-Type the reuse identifier

...