Reputation: 2940
Im trying to find a direct way to put MKCoordinateSpan into an array without breaking it down to lat and long and store it in an NSArray. Not sure if there is such way.
Upvotes: 1
Views: 241
Reputation: 63707
MKCoordinateSpan span = MKCoordinateSpanMake(1.0, 1.0);
NSData *data = [NSData dataWithBytes:&span length:sizeof(span)];
MKCoordinateSpan back;
[data getBytes:&back length:sizeof(back)];
NSLog(@"%f",back.latitudeDelta);
Upvotes: 1
Reputation: 727077
Try this:
MKCoordinateSpan currentSpan;
currentSpan = ...; // Set the span to somethinf
NSValue *spanVal = [NSValue valueWithBytes:¤tSpan objCType:@encode(MKCoordinateSpan)];
...
MKCoordinateSpan currentSpanBack;
[spanVal getValue:¤tSpanBack];
Upvotes: 0