开发者社区 问答 正文

关于startMonitoring在ios5不运行 的问题

初始化location Manager

self.locationManager = [[[CLLocationManager alloc] init] autorelease];
self.locationManager.delegate = self;
[self.locationManager startMonitoringSignificantLocationChanges];

ios6中,创建之后,当前的location就会调用delegates
`- (void)locationManager:(CLLocationManager )manager didUpdateLocations:(NSArray )locations
`

但是在ios5中测试的时候,delegates就没有被调用。
为什么?

展开
收起
爵霸 2016-03-24 08:57:11 1749 分享 版权
1 条回答
写回答
取消 提交回答
  • 问题是方法:

    - (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations

    是iOS6新的, 在iOS5中需要使用:

    - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocatio
    2019-07-17 19:11:51
    赞同 展开评论
问答标签:
问答地址: