【发布时间】:2017-10-26 05:23:52
【问题描述】:
MapPinAnnotation 是我定义的MKAnnotation 类型的一个类
var lblNotificationCount:UILabel!
我想在标签处设置文本,但出现如下错误:-
let storeAnnotation = annotation as! MapPinAnnotation
并且在控制台中我能够获得计数值,但它打印错误如下:-
控制台输出:
Count: 1
fatal error: unexpectedly found nil while unwrapping an Optional value
请帮助,如何解决这个问题。提前致谢。
【问题讨论】:
-
.text = String(count) ... 试试
-
@cerberus,不工作。
标签: swift3 uilabel mapkit mkannotationview