Как заголовок, я запутался в том, как захватывать карты с помощью MonoTouch и как получить местоположение.Шаг за шагом:
CLLocationManager locationManager = new CLLocationManager ();
locationManager.UpdatedLocation += UpdatedLocationEvent;
locationManager.Delegate = new MyLocationDelegate ();
locationManager.StartUpdatingLocation ();
class MyLocationDelegate : CLLocationManagerDelegate
{
public MyLocationDelegate () : base()
{
}
public override void UpdatedLocation (CLLocationManager manager, CLLocation newLocation, CLLocation oldLocation)
{
Console.WriteLine ("newLocation " + newLocation.VerticalAccuracy + " " + newLocation.HorizontalAccuracy);
Console.WriteLine ("oldLocation " + oldLocation.VerticalAccuracy + " " + oldLocation.HorizontalAccuracy);
}
public override void Failed (CLLocationManager manager, NSError error)
{
Console.WriteLine ("Failed to find location");
}
}
Не работает.Пожалуйста, помогите мне.