I'm trying to request permission to get someones location but the app crashes because of a connection I have.
Other people have suggested to check any outlets that aren't connected. I only have one and I have deleted it and reconnected it multiple times. I don't believe that is the problem but I may be missing something. I think the problem is something else to do with the fact that I was following an old tutorial.
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x7feb27510490> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key mainMapView.'
This is my code:
func checkLocationAuthorization() {
switch CLLocationManager.authorizationStatus() {
case .authorizedWhenInUse:
//do map stuff
break
case .denied:
// show alert to turn on permissions
break
case .notDetermined:
// havent picked yet
locationManager.requestWhenInUseAuthorization()
case .restricted:
//show alert
break
case .authorizedAlways:
break
}
}
I'm also getting an alert on the switch; saying it may have additional unknown values. that might be the issue