当我尝试在iPhone 5S(64位)上编译时,我收到此错误:
存储值类型与指针操作数类型不匹配!店铺i64%387, double *%indirect-temporary.span.latitudeDelta.value,align 8,!dbg !471 doubleStored值类型与指针操作数类型不匹配! 店铺i192%400,双* %indirect-temporary.span.longitudeDelta.value,align 8,!dbg!471 doubleLLVM错误:找到破碎的功能,编译中止!命令 /Applications/Xcode6-Beta5.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc 退出代码1失败
修改
问题在于这个功能:
func georeverseAddress(addess: String!) {
var geocoder = CLGeocoder()
geocoder.geocodeAddressString(addess,
completionHandler:({ (placemarks: [AnyObject]!, error: NSError!) in
if error != nil {
self.delegate.incomingError!(error)
return
}
if placemarks.count > 0 {
var cp : CLPlacemark = placemarks[0] as CLPlacemark
var locationn = cp.location
var cord = locationn.coordinate
self.delegate.incomingUserLocation!(MKCoordinateRegionMake(cord, MKCoordinateSpanMake(0.005, 0.005))) // <--- Error Here
var pin = Pin(coordinate: cord)
var coordinate = "\(cord.latitude) \(cord.longitude)"
pin.title = addess
pin.subtitle = coordinate
self.delegate.incomingPin!(pin)
}
}))
}
最终编辑
如果我们避免嵌套调用:
var cp : CLPlacemark = placemarks[0] as CLPlacemark
var span = MKCoordinateSpanMake(0.005, 0.005)
var reg = MKCoordinateRegionMake(cp.location.coordinate, span)
self.delegate.incomingUserLocation!(reg)
错误消失了,但现在我的退出代码254失败了:
var reg = MKCoordinateRegionMake(cp.location.coordinate, span) // Error 254 here
它很奇怪,或者我误解了什么?