MapPinAnnotation是MKAnnotation类型的一个类,我在其中定义了
var lblNotificationCount:UILabel!我想在标签处设置文本,但出现错误,如下所述:
let storeAnnotation = annotation as! MapPinAnnotation

在控制台中,我可以获得计数的值,但它打印错误如下:-
控制台输出:
Count: 1
fatal error: unexpectedly found nil while unwrapping an Optional value请帮助,如何解决这个问题。提前谢谢。
发布于 2017-10-26 15:18:17
这可能会有所帮助:
storeAnnotation.lblNotificationCount.text = String(describing: count)https://stackoverflow.com/questions/46946389
复制相似问题