配列は次のとおりです。なぜ迅速なコンパイラは省略名の引数名を受け入れないのでしょうか?
let closestStationAnnotations = closestAnnotations.filter({
$0.dynamicType === StationAnnotation.self
})
Cannot convert value of type (_) -> Bool to expected argument type (MKAnnotation) -> Bool
をしかし受け入れる:var closestAnnotations:[MKAnnotation]
迅速コンパイラは受け付けませんなぜ私が思っていた私がしようとしている
let closestStationAnnotations = closestAnnotations.filter({
(annotation : MKAnnotation) -> Bool in
annotation.dynamicType === StationAnnotation.self
})
「closestAnnotations」はどのように宣言されていますか? – Sulthan
私の編集をご覧ください! :) –
匂いがバグです。 '.dynamicType'は[通常のメンバーアクセス](https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Expressions.html#//apple_ref)ではないという事実に関連していると思います/ doc/uid/TP40014097-CH32-ID400)、[特別な表現](https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Expressions.html#//apple_ref/doc/uid/TP40014097-CH32-ID402)。しかし、私はこれについて合理的な説明を見つけることができません。 – rintaro