Ios5 CLLocationManager未更新位置
这与我的另一个相关,但我正在使用iOS标签打开一个新的,因为问题可能出在本机端 问题:位置管理器未更新位置。我试着阅读Ios5 CLLocationManager未更新位置,ios5,gps,titanium,core-location,cllocationmanager,Ios5,Gps,Titanium,Core Location,Cllocationmanager,这与我的另一个相关,但我正在使用iOS标签打开一个新的,因为问题可能出在本机端 问题:位置管理器未更新位置。我试着阅读locationManager.location,它总是给我一个缓存的位置 然后我修改了代码以使用CLLocationManagerDelegate和-(void)locationManager:(CLLocationManager*)manager diddupdatetolocation:(CLLocation*)newLocation fromLocation:(CLLoc
locationManager.location
,它总是给我一个缓存的位置
然后我修改了代码以使用CLLocationManagerDelegate
和-(void)locationManager:(CLLocationManager*)manager diddupdatetolocation:(CLLocation*)newLocation fromLocation:(CLLocation*)oldLocation{}
从来没有人打过电话
我的.h文件:
#import "TiModule.h"
#import <CoreLocation/CoreLocation.h>
#import <CoreMotion/CoreMotion.h>
@interface TiMovementModule : TiModule<CLLocationManagerDelegate>
@property (nonatomic, retain) CLLocationManager *locationManager;
@property (nonatomic, readonly) NSDictionary *currentMovement;
- (void)startMovementUpdates:(id)args;
- (void)stopMovementUpdates:(id)args;
@end
您应该尝试在此行上放置断点:
[self.locationManager startUpdatingLocation];
查看您是否曾经到达那里,因为代码中没有证据表明它曾经被执行过。答案是位置更新必须从主线程完成。 在Tianium中,您只需在函数开始时调用Surveue_UI_线程
[self.locationManager startUpdatingLocation];