佚名通过本文主要向大家介绍了地图转为cad,怎样把图片转为pdf,怎样把pdf转为word,怎样把视频转为音频,怎样把图片转为word等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
问题: 地图,怎样把CLLocationCoordinate2D转为CLLocation?
描述:
解决方案1:
描述:
怎样把CLLocationCoordinate2D转为CLLocation?
解决方案1:
写个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