Xcode 6 GM无法在iOS 8模拟器中模拟位置

3
我使用Xcode的“模拟位置”按钮和iOS模拟器的“调试>位置>自定义位置”来设置位置,但这些方法并不起作用。同时,Maps应用也无法获取位置信息。
当然,我已经更新了iOS 8的CLLocationManager代码,例如“requestAlwaysAuthorization”和“NSLocationAlwaysUsageDescription”。

在我的情况下,位置仅适用于iPhone 6 Plus模拟器。为什么? - Vaibhav Saran
3个回答

5

编辑您的计划:

  1. 在选项标签中,确保您勾选了“允许位置模拟”。
  2. 选择一个默认位置(可选)。
  3. 重置模拟器的内容和设置。这对我有用。

附注:您可能需要重新启动Xcode IDE。

enter image description here


我已经配置了选项和默认位置。重置内容让我顺利完成了任务。谢谢。 - Adrian

0

这是我的临时解决方案:

- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
{
    [self locationManager:manager didUpdateLocations:@[[[CLLocation alloc] initWithLatitude:<#(CLLocationDegrees)#> longitude:<#(CLLocationDegrees)#>]]];
    return;

    // Something you should do when Xcode not crazy
}

0

在XCode6中有同样的问题,但现在在Xcode 6.1中已经正常工作了


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接