xamarin.ios - CLLocation does not have a Coordinates property -


i working way through location services first time , appears working in correctly finds location having trouble extracting coordinates.

the docs states cllocation has "coordinates" property , compiler happy piece of code. @ runtime cllocation appears return string description.

i start location manager

    _locationmanager = new cllocationmanager ();     _locationmanager.desiredaccuracy = 1000;       // handle updated location method , update ui     _locationmanager.locationsupdated += (object sender, cllocationsupdatedeventargs e) => {             updatelocation (e.locations [e.locations.length - 1], _destinationlatitude, _destinationlongitude);         };      if (cllocationmanager.locationservicesenabled)         _locationmanager.startupdatinglocation (); 

the event fires correctly

    static public void updatelocation (cllocation current, double destinationlat, double destinationlng)     {         //make start pairing         string start = current.coordinate.latitude.tostring() + "," + current.coordinate.longitude.tostring();          //make destination pairing         string destination = destinationlat.tostring() + "," + destinationlng.tostring();     } 

however app crashes out. catching on breakpoint see following appears have description property contains.

description "<+50.58198902,-3.67661728> +/- 65.00m (speed -1.00 mps / course -1.00) @ 25/07/2013 13:11:28 british…" string 

i can extract lat/lng text field feeling shouldn't need this. appreciated.

enter image description here

i moved exact same code different controller , worked fine. difference between 2 controllers failing controller using monotouch dialog reflection api bind screen elements. can't see why make difference difference between 2 controllers. working now, try reproduce in smaller sample if time.


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -