想要使用核心位置的仅限wifi的iPad会发生什么?

时间:2011-03-09 13:20:17

标签: ipad gps core core-location

一位商业客户报告我为他制作的应用程序在他的iPad上崩溃了。它在启动后就崩溃了。

我在几台iPad上测试没有问题。我唯一能想到的是他有一台没有GPS的无线iPad。我的应用程序使用核心位置。

我实施了

- (void)locationManager:(CLLocationManager *)manager 
   didFailWithError:(NSError *)error {}

所以我认为没关系。

但是核心位置的使用是否会导致iPad崩溃?我知道我可以用 UIRequiredDeviceCapabilities

解决这个问题

1 个答案:

答案 0 :(得分:1)

不,这不应该是iPad崩溃的原因。例如,这在仅用于wifi的iPad(刚测试)上工作正常:

if (self.locMgr == nil)
{
    self.locMgr = [[[CLLocationManager alloc] init] autorelease];
    self.locMgr.delegate = self;
}

if (self.locMgr != nil)
{       
    if ([self.locMgr respondsToSelector:@selector(startMonitoringSignificantLocationChanges)])
    {
        [self.locMgr startMonitoringSignificantLocationChanges];
    }

    [self.locMgr startUpdatingLocation];
}

}

它不会崩溃,甚至可以根据wifi信号启动位置监控。