0

I have a problem that when I run my code it gives me Thread 1: EXC_BAD_ACCESS(code=1, address=0x10)

@IBAction func sendMessage(sender: AnyObject){

var placemark = CLPlacemark()

var messageVC = MFMessageComposeViewController()

var locaiton = placemark.country //Thread was here

messageVC.recipients = ["Enter tel-nr"]
messageVC.messageComposeDelegate = self;

self.presentViewController(messageVC, animated: false, completion: nil)


self.locationManager.delegate = self

self.locationManager.desiredAccuracy = kCLLocationAccuracyBest

self.locationManager.requestWhenInUseAuthorization()

self.locationManager.startUpdatingLocation()

messageVC.body = (locaiton)

}

Hope you can help!

Josh

Josh S.
  • 1
  • 1

1 Answers1

0

Check out this post on how to use CLPlacemark: Swift - CLGeocoder reverseGeocodeLocation completionHandler closure

CLPlacemarks aren't meant to be instanced directly but are generated as the result of a reverse geocoding operation.

Community
  • 1
  • 1
Xavier Lowmiller
  • 1,381
  • 1
  • 15
  • 24