BX6*_*X69 2 objective-c ios swift
将此系列Objective C代码转换为Swift时遇到问题
for (id <MKAnnotation> annotation in mapView.annotations) {
// Do Something
}
Run Code Online (Sandbox Code Playgroud)
当我尝试:
for (annotation:MKannotation in mapView.annotations)
Run Code Online (Sandbox Code Playgroud)
要么
for (annotation in mapView.annotations)
Run Code Online (Sandbox Code Playgroud)
我明白了:'期待';' 在'for'声明中
谢谢!!
BX6*_*X69 10
这是答案:
for annotation in mapView.annotations as [MKAnnotation] {...}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1658 次 |
| 最近记录: |