用NSMutableArray 存储结构体 CLLocationCoordinate2D
来源:互联网 发布:从零开始学编程 编辑:程序博客网 时间:2024/06/05 13:27
@property (retain, nonatomic) NSMutableArray *posArrays;
// Handles the start of a touch
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
[self.mapViewremoveOverlays:self.mapView.overlays];
if (!posArrays)
{
[posArraysremoveAllObjects];
}
else
{
self.posArrays = [NSMutableArrayarray];
}
CGPoint touchPoint = [[[eventallTouches] anyObject] locationInView:self.view];
CLLocationCoordinate2D beginCL =[mapViewconvertPoint:touchPoint toCoordinateFromView:self.view];
CLLocation *towerLocation = [[CLLocationalloc] initWithLatitude:beginCL.latitudelongitude:beginCL.longitude];
[posArrays addObject:towerLocation];
[towerLocation release];
}
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
CGPoint touchPoint = [[[eventallTouches] anyObject] locationInView:self.view];
CLLocationCoordinate2D beginCL =[mapViewconvertPoint:touchPoint toCoordinateFromView:self.view];
CLLocation *towerLocation = [[CLLocationalloc] initWithLatitude:beginCL.latitudelongitude:beginCL.longitude];
[posArrays addObject:towerLocation];
[towerLocation release];
}
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
CLLocationCoordinate2D commuterLotCoords[[posArrayscount]];
for (int i=0; i<[posArrayscount]; i++)
{
commuterLotCoords[i]=[[posArraysobjectAtIndex:i] coordinate];
}
NSLog(@"%@",posArrays);
MKPolygon *commuterPoly1 = [MKPolygonpolygonWithCoordinates:commuterLotCoords count:[posArrayscount]];
[self.mapViewaddOverlay:commuterPoly1];
}
- 用NSMutableArray 存储结构体 CLLocationCoordinate2D
- iOS里NSMutableArray 存取 CLLocationCoordinate2D
- CLLocationCoordinate2D 初始化
- 【IOS】如何封装结构体对象到NSMutableArray中
- 黑马程序员 OC语言 - 7 结构体、NSString、NSArray、NSMutableArray
- 怎么用NSMutableArray存储CGPoint,CGSize,CGRect,CGAffineTransform,UIEdgeInsets,UIOffset
- 用QSet存储一个自定义结构体
- 结构体的存储
- 结构体存储
- 结构体存储
- 结构体存储分配
- 结构体存储对齐
- 结构体存储方式
- 使用CLLocationCoordinate2D报错
- 基本结构的数组 NSArry NSMutableArray
- NSMutableArray
- NSMutableArray
- NSMutableArray
- linux目录结构
- 周鸿祎谈做手机:我觉得马化腾不可能不动
- POI读取Excel 03/07
- Pingdom:全球排名前1万网站有24.3%使用了Facebook官方插件
- [转]C# GDI+ 简单绘图(一)
- 用NSMutableArray 存储结构体 CLLocationCoordinate2D
- vs2010 包含库头文件,库文件 配置
- java执行ping命令
- ibatis 返回list<String[]>----resultClass="hashMap" 可以实现
- c# is和as的区别
- 查询数据库中所有记录总数不为0的数据表名称
- 随笔十:虚拟存储器
- Sybase PowerDesigner 12通用的破解方法
- Oracle 11g R- 11.2.0.3.0补丁程序