无法将类型'AppDelegate'的值分配为'CLLocationManagerDelegate?'

时间:2016-03-09 18:49:42

标签: ios swift core-location

我导入CoreLocation,然后在locationManager.delegate = selfdidFinishLaunchingWithOptions中添加let locationManager = CLLocationManager()

但我在AppDelegate中遇到此错误。我错了什么?

1 个答案:

答案 0 :(得分:13)

您需要使AppDelegate符合CLLocationManagerDelegate。 class AppDelegate:UIApplicationDelegate,CLLocationManagerDelegate {}