0
以下代码给我一个Extra argument 'userinfo' in call
错误。我已经看过了建议,由@27620493和27875005调用CLLocation中的额外参数'userinfo'
class SOViewController : UIViewController {
var currentLocation : CLLocation!
func setCurrentLocation(currentLocation: CLLocation) {
if (self.currentLocation == currentLocation) {
return
}
self.currentLocation = currentLocation
dispatch_async(dispatch_get_main_queue(), NSNotificationCenter.defaultCenter().postNotificationName(aName: SOCurrentLocationDidChangeNotification, object: nil, userInfo: ["kSOLocationKey" : currentLocation]))
}
我不知道为什么我收到此错误考虑currentLocation
是可选的。