当它遇到以下代码时,我遇到了一个错误(程序崩溃)
CLLocation *userLoc = [[CLLocation alloc] initWithCoordinate:locationManager.location.coordinate];
我试图用以下内容替换参数,我也得到了同样的错误
CLLocation *userLoc = [[CLLocation alloc] initWithCoordinate:mapView.userLocation.coordinate];
任何人都可以就用户当前位置在此处使用的正确参数提供建议吗?
谢谢!
甄
堆栈跟踪:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CLLocation initWithCoordinate:]: unrecognized selector sent to instance 0x1e0620'