怎样把CLLocationCoordinate2D转为CLLocation?
写个Category呗:
//.h
#import <CoreLocation/CoreLocation.h>
@interface CLLocation (ConstructWithCoordinate)
+ (CLLocation *)constructWithCoordinate:(CLLocationCoordinate2D)coordinate;
@end
//.m
@implementation CLLocation (ConstructWithCoordinate)
+ (CLLocation *)constructWithCoordinate:(CLLocationCoordinate2D)coordinate {
return [[CLLocation alloc] initWithLatitude:coordinate.latitude longitude:coordinate.longitude];
}
@end