以下代码给了我一个Extra argument 'userinfo' in call
错误。我查看了来自@27620493和27875005的建议
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
是可选的。