I find it difficult to add a C-struct to NSDictionary.
C-struct is MKCoordinateRegion on MapKit.h.
This ad
typedef struct { CLLocationCoordinate2D center; MKCoordinateSpan span; } MKCoordinateRegion;
and ad CLLocationCoordinate2D
typedef struct { CLLocationDegrees latitude; CLLocationDegrees longitude; } CLLocationCoordinate2D;
MKCoordinateSpan is the same.
Now I want to add MKCoordinateRegion to NSDictionary.
CLLocationCoordinate2D center = CLLocationCoordinate2DMake(40.723128, -74.000694); MKCoordinateSpan span = MKCoordinateSpanMake(1.0, 1.0); MKCoordinateRegion region = MKCoordinateRegionMake(center, span); NSMutableDictionary *param = [[NSMutableDictionary alloc] init]; [param setObject:region forKey:@"region"];
5 row has an error.
error message "Sending" MKCoordinateRegion "to an incompatible type parameter" id ""
Thanks.
source share