【问题标题】:Save MKPointAnnotation to Firestore将 MKPointAnnotation 保存到 Firestore
【发布时间】:2019-01-16 03:34:57
【问题描述】:

我有 [mkmapview annotations] 这是 MKPointAnnotation 的数组

我正在尝试将 ti 作为数组保存到 FireStore,但不接受 MKPointAnnotation 对象

然后我尝试将 MKPointAnnotation 转换为 FIRGeoPoint 但没有运气

for (MKPointAnnotation *point in annotationsArray) {
        FIRGeoPoint *FirAnnotations;
        FirAnnotations = [FirAnnotations initWithLatitude:point.coordinate.latitude longitude:point.coordinate.longitude];
        NSLog(@"FirAnnotations: %@",FirAnnotations);
    }

annotationsArray 是 [mkmapview 注释]

总是为空

【问题讨论】:

    标签: objective-c firebase google-cloud-firestore geopoints mkpointannotation


    【解决方案1】:

    我正在尝试使用 FirAnnotations 指针来调用 init,但它为 nil,我应该在那里使用 FIRGeoPoint。

    for (MKPointAnnotation *point in annotationsArray) {
            FIRGeoPoint *FirAnnotations;
            FirAnnotations = [[FIRGeoPoint alloc] initWithLatitude:point.coordinate.latitude                                                longitude:point.coordinate.longitude];
            NSLog(@"annotations: %@",annotations);
    }
    

    【讨论】:

      猜你喜欢
      • 2019-09-21
      • 2018-06-25
      • 2021-12-31
      • 1970-01-01
      • 2019-11-15
      • 2020-05-17
      • 2020-08-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多