我在swift 3.0中写作
我有这个代码,它给我警告结果,呼叫未使用
public override init(){
super.init()
}
public init(annotations: [MKAnnotation]){
super.init()
addAnnotations(annotations: annotations)
}
public func setAnnotations(annotations:[MKAnnotation]){
tree = nil
addAnnotations(annotations: annotations)
}
public func addAnnotations(annotations:[MKAnnotation]){
if tree == nil {
tree = AKQuadTree()
}
lock.lock()
for annotation in annotations {
// The warning occurs at this line
tree!.insertAnnotation(annotation: annotation)
}
lock.unlock()
}
Run Code Online (Sandbox Code Playgroud)
我已经尝试在另一个类中使用此方法,但它仍然给我错误,insertAnnotation的代码在上面
func insertAnnotation(annotation:MKAnnotation) -> Bool {
return insertAnnotation(annotation: annotation, toNode:rootNode!)
}
func insertAnnotation(annotation:MKAnnotation, toNode node:AKQuadTreeNode) -> Bool {
if !AKQuadTreeNode.AKBoundingBoxContainsCoordinate(box: node.boundingBox!, coordinate: annotation.coordinate) {
return false …
Run Code Online (Sandbox Code Playgroud) 我有这个代码
var times = [NSValue]()
for time in timePoints {
times.append(NSValue(CMTime : time))
}
Run Code Online (Sandbox Code Playgroud)
我得到一个错误,他们在swift 3中没有什么叫做CMTime我真的找不到cm时间的任何参数.