我试图在保护语句中调用一个名为“nextPage”的函数,但它说“()”不能转换为“布尔”。我需要做什么才能调用此函数
@IBAction func nextPressed(_ sender: Any) {
let geoCoder = CLGeocoder()
geoCoder.geocodeAddressString(address) { (placemarks, error) in
guard
let placemark = placemarks?.first,
let latVar = placemark.location?.coordinate.latitude,
let lonVar = placemark.location?.coordinate.longitude,
nextPage() // Error - '()' is not convertible to 'Bool'
else {
print("no location found")
return
}
}
}