【问题标题】:wait_fences: failed to receive reply: 10004003 in CLLocationwait_fences:未能收到回复:CLLocation 中的 10004003
【发布时间】:2012-04-23 11:16:45
【问题描述】:
locationManager = [[CLLocationManager alloc] init];

locationManager.delegate = self;

locationManager.distanceFilter = kCLDistanceFilterNone; // whenever we move

locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters; // 100 m

[locationManager startUpdatingHeading];

当我在 viewWillAppear 中使用此代码时,我有时会遇到此警告,因此 没有调用的委托方法

- (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading 

【问题讨论】:

    标签: iphone objective-c location cllocationmanager cllocation


    【解决方案1】:

    我认为您使用以下代码嵌入您的代码...

    locationManager = [[CLLocationManager alloc] init];
    
    locationManager.delegate = self;
    
    locationManager.distanceFilter = kCLDistanceFilterNone; // whenever we move
    
    locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters; // 100 m
    
    [locationManager startUpdatingHeading];
    

    您在分配 locationManager 对象后首先定义startUpdatingHeading 方法......所以可能是这个错误的问题...... 如果再次出现此问题,请留下评论.... 希望这对你有帮助.... :-)

    【讨论】:

      【解决方案2】:

      -viewWillAppear: 方法中的某些内容比显示视图的动画花费的时间更长。如果是CLLocationManager,也许您可​​以从后台线程或运行循环的下一轮启动它。

      dispatch_queue_t q = /* bg queue or main queue */
      dispatch_async(q, ^{
          /* your CLLocationManager code */
      });
      

      【讨论】:

        猜你喜欢
        • 2011-05-02
        • 2010-11-25
        • 1970-01-01
        • 1970-01-01
        • 2012-09-17
        • 1970-01-01
        • 1970-01-01
        • 2011-02-05
        • 1970-01-01
        相关资源
        最近更新 更多