小编Wan*_*Lin的帖子

在Swift中使用isKindOf

我使用Xcode 8.0 beta来测试我的应用程序,但在将我的代码2.2转换为3.0之后,出现了许多未解决的错误.在演示下面,Xcode8.0出现错误消息

1.在"如果"条件之后预期"{"

    if annotation.isKindof: (MKUserLocation) {
        return nil
    } 
Run Code Online (Sandbox Code Playgroud)

第二个错误是地图套件...我使用iskind(of:MKUserLocation)仍然无法解决,它会出现另一个错误消息

2.Braced语句块是一个未使用的闭包

    if annotation.isKindof: (MKUserLocation) {
        return nil
    }
Run Code Online (Sandbox Code Playgroud)

3.在通话中缺少参数标签'of:'

    if annotation.isKind(of: MKUserLocation) {
        return nil
    }
Run Code Online (Sandbox Code Playgroud)

foundation ios swift swift3

31
推荐指数
1
解决办法
2万
查看次数

标签 统计

foundation ×1

ios ×1

swift ×1

swift3 ×1