CLLocationmanager在大约30秒后抛出

时间:2010-09-22 04:52:48

标签: xamarin.ios core-location

@首先我认为它没有开火,但看到了this

所以我等了,现在我得到了未处理的异常:MonoTouch.Foundation.You_Should_Not_Call_base_In_This_Method:抛出了类型'MonoTouch.Foundation.You_Should_Not_Call_base_In_This_Method'的异常。在失败的处理程序中。

我已经定义了一个CLLocationManager,这里是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);
            }
        }

我正在使用最新的monodevelop,monotouch,xcode和iphone SDK,刚刚安装了一个coupla天前。有什么建议吗?

此致

_Eric

1 个答案:

答案 0 :(得分:1)

例外情况是你不应该在重写的“失败”方法中调用base.Failed。