Bosoud
Bosoud

Reputation: 158

Save MKPointAnnotation to Firestore

I have [mkmapview annotations] which is array of MKPointAnnotation

I am trying to save ti to FireStore as array but is not accepted the MKPointAnnotation object

then I try to convert MKPointAnnotation to FIRGeoPoint but no luck

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

annotationsArray is [mkmapview annotations]

always get null

Upvotes: 0

Views: 93

Answers (1)

Bosoud
Bosoud

Reputation: 158

i'am attempting to use the FirAnnotations pointer to call init but it's nil and i should be using the FIRGeoPoint there.

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

Upvotes: 0

Related Questions