0

MapPinAnnotation is a class of MKAnnotation type in which I have defined

var lblNotificationCount:UILabel!

I want to set text at label but getting error as described below: -

let storeAnnotation = annotation as! MapPinAnnotation

enter image description here

and in console i am able to get value of count but it print error as below: -

Console Output:

Count: 1
fatal error: unexpectedly found nil while unwrapping an Optional value

Please help, how to resolve this issue. Thanks in advance.

Asif Raza
  • 836
  • 12
  • 29

1 Answers1

0

This might be helpful:

storeAnnotation.lblNotificationCount.text = String(describing: count)
Vaibhav Parmar
  • 461
  • 4
  • 14