zoukankan      html  css  js  c++  java
  • server did not accept client registration

    在模拟器上获取Location出现“server did not accept client registration”错误,查询得知这是一个bug(xcode 3.2.6)

    解决方法是在xxAppDelegate.m文件顶部(imports之后,@implementation之前)添加下面的Hack代码:

    代码出处:http://forums.bignerdranch.com/viewtopic.php?f=79&t=2069

    @implementation CLLocationManager (TemporaryHack)
    
    - (void)hackLocationFix
    {
        CLLocation *location = [[CLLocation alloc] initWithLatitude:42 longitude:-50];
        [[self delegate] locationManager:self didUpdateToLocation:location fromLocation:nil];     
    }
    
    - (void)startUpdatingLocation
    {
        [self performSelector:@selector(hackLocationFix) withObject:nil afterDelay:0.1];
    }
    
    @end
    


    签名:删除冗余的代码最开心,找不到删除的代码最痛苦!
  • 相关阅读:
    Shell 中的 expect 命令
    #每日日报#7.11
    #每日日报#7.10
    #每日日报#7.09
    #每日日报#7月8日
    每日日报2020.7.17
    每日日报2020.7.16
    每日日报2020.7.15
    每日日报2020.7.14
    每日日报2020.7.13
  • 原文地址:https://www.cnblogs.com/season2009/p/2548149.html
Copyright © 2011-2022 走看看