【问题标题】:CLLocation manager throws after ~30secondsCLLocationmanager 在约 30 秒后抛出
【发布时间】:2010-09-22 04:52:48
【问题描述】:

@起初我以为它没有开火,但看到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。有什么建议吗?

问候

_埃里克

【问题讨论】:

    标签: xamarin.ios core-location


    【解决方案1】:

    例外是说您不应该在覆盖的“失败”方法中调用 base.Failed。

    【讨论】:

    • 我不确定。我还在用 4.0.1
    • 只是补充一下,它仍然失败,我需要打开机场,即使我有强硬路线
    猜你喜欢
    • 1970-01-01
    • 2015-08-24
    • 2021-04-08
    • 2020-05-03
    • 1970-01-01
    • 2011-01-05
    • 2017-03-16
    • 1970-01-01
    • 2020-03-29
    相关资源
    最近更新 更多