【问题标题】:Gimbal Geofence monitoring crashing NSInvalidArgumentException -[NSURL initFileURLWithPath:]云台地理围栏监控崩溃 NSInvalidArgumentException -[NSURL initFileURLWithPath:]
【发布时间】:2014-06-24 05:58:06
【问题描述】:

在集成 Gimbal FYX 信标发现后,我也尝试添加地理围栏监控。我密切关注指南并多次重写代码,最终得到相同的崩溃和错误消息:

* 由于未捕获的异常 'NSInvalidArgumentException' 导致应用程序终止,原因:'* -[NSURL initFileURLWithPath:]: nil string parameter'

在我的代码中,我没有访问任何文件或从 initWithContentsOfFile: 方法创建任何 NSObjects!

我的代码:

[connector enableFromViewController:viewController success:^{
        NSLog(@"ContextCoreConnector ACTIVATED!");
        self.placeConnector = [[QLContextPlaceConnector alloc] init];
        self.placeConnector.delegate = self;

        [self.placeConnector monitorPlacesWhenAllowed];
        [self.placeConnector monitorPlacesInBackground];

        if ([self.geofenceDelegate respondsToSelector:@selector(startedGeofenceMonitoring)]) {
            [self.geofenceDelegate startedGeofenceMonitoring];
        }

    } failure:^(NSError *error) {
        NSLog(@"ContextCoreConnector FAILED!\n%@",error.localizedDescription);

        if ([self.geofenceDelegate respondsToSelector:@selector(startedGeofenceMonitoring)]) {
            [self.geofenceDelegate startedGeofenceMonitoring];
        }

    }];

【问题讨论】:

    标签: ios7 geofencing gimbal


    【解决方案1】:

    原来在 ContextLocation.framework 中有一个名为“Resources”的文件夹,并且有一个 DataModels.bundle 文件,您需要在 XCode 的右侧面板中检查“Target Membership”。我按照指南的建议检查了我所有的框架,但没有检查资源文件夹。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-04-28
      • 1970-01-01
      • 1970-01-01
      • 2018-11-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多