仅支持 Wi-Fi 的 iPad 想要使用核心位置会发生什么?

问题描述 投票:0回答:1

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

我在几台 iPad 上进行了测试,没有出现任何问题。我唯一能想到的是他有一个只有wifi的iPad,没有GPS。我的应用程序使用核心位置。

我实施了

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

所以我想这样就可以了。

但是核心定位的使用会不会是iPad崩溃的原因呢?我知道我可以用 UIRequiredDeviceCapability

解决这个问题
ipad gps core-location
1个回答
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信号启动位置监控。

© www.soinside.com 2019 - 2024. All rights reserved.