【发布时间】:2014-09-20 13:51:13
【问题描述】:
我现在苦苦挣扎了几天,但我无法解决我的问题(尽管这里有关于 SO 的所有信息)。对不起,我很愚蠢。
在我的应用中,位置服务在 iOS 8 中停止工作。在此版本之前,一切正常。 我在这里读到 de plist 文件中必须有一些键,并且必须使用外部编辑器设置它们。
这里是:
但它仍然无法正常工作。在模拟器中,或者在我的设备上,我不会被提示。
我也知道在我的文件中添加一些代码。 我应该添加什么代码,我应该在哪里添加?
这是我的 .h 文件:
@property (strong, nonatomic) CLLocationManager *location;
这是在我的 .m 文件中:
@synthesize location;
-(void) locationStuff {
//Get location en set MapView
location=[[CLLocationManager alloc]init];
location.delegate=self;
location.desiredAccuracy=kCLLocationAccuracyBest;
location.distanceFilter=kCLDistanceFilterNone;
location.pausesLocationUpdatesAutomatically = NO;
[self startUpdatingLocation];
[mapView setDelegate:self];
[mapView setUserTrackingMode:MKUserTrackingModeFollow animated:YES];
[mapView setCenterCoordinate:mapView.userLocation.location.coordinate animated:YES];
[[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithBool:NO] forKey:@"appRunning"];
[[NSUserDefaults standardUserDefaults] synchronize];
}
有人可以帮帮我吗?感谢并再次抱歉,我不理解其他问题的答案。我真的需要一些简单的解释。
【问题讨论】:
标签: ios ios8 cllocationmanager