2010-09-22 7 views
0

@ d'abord je pensais que ce n'a pas été mise à feu, mais vu thisgestionnaire de CLLocation jette après ~ 30 secondes

J'attendirent et maintenant je reçois Exception non gérée: MonoTouch.Foundation.You_Should_Not_Call_base_In_This_Method: Exception de type « MonoTouch.Foundation. You_Should_Not_Call_base_In_This_Method 'a été lancé. dans le gestionnaire défaillant.

J'ai défini un CLLocationManager, ici est FinishedLaunching & CLLocationManagerDelegate

public override bool FinishedLaunching (UIApplication app, NSDictionary options) 
      { 
       // If you have defined a view, add it here: 
       // window.AddSubview (navigationController.View); 

       _locationManager = new CLLocationManager(); 
       _locationManager.Delegate = new LocationManagerDelegate(this); 
       _locationManager.StartUpdatingLocation(); 

       window.MakeKeyAndVisible(); 


       return true; 
      } 




private class LocationManagerDelegate : CLLocationManagerDelegate 
     { 
      private AppDelegate _appd; 
      public LocationManagerDelegate(AppDelegate appd) 
      { 
       _appd = appd; 
       Console.WriteLine("Delegate created"); 
      } 
      public override void UpdatedLocation(CLLocationManager manager 
                , CLLocation newLocation, CLLocation oldLocation) 
      { 
       Console.WriteLine("Lat: " + newLocation.Coordinate.Latitude.ToString()); 


      } 
       public override void Failed (CLLocationManager manager, NSError error) 
      { 
       //_appd.labelInfo.Text = "Failed to find location"; 
       Console.WriteLine("Failed to find location"); 
       base.Failed (manager, error); 
      } 
     } 

J'utilise la dernière monodevelop, MonoTouch, Xcode et le SDK iPhone, vient d'être installé il y a quelques jours coupla. Aucune suggestion?

Cordialement

_Eric

Répondre

1

L'exception est dit que vous ne devez pas appeler base.Failed dans la méthode "a échoué" surchargée.

+0

Oui, merci. Tard dans la nuit. Va-t-il toujours échouer dans la simulation 4.1? – Eric

+0

Je ne suis pas sûr de ça. J'utilise toujours 4.0.1 – kwcto

+0

Juste pour ajouter, ça manquait encore, je devais tourner à l'aéroport, même si j'avais une ligne dure – Eric

Questions connexes