关于地图的操作的代码片段
2012-05-30 09:36
232 查看
这种方法在application bundle的顶层文件夹寻找由供应的名字的图象 。 如果找到图片,装载到iPhone系统缓存图象。那意味图片是(理论上)放在内存里作为cache的。
图片cache极有可能不会响应 memory warnings and release its objects:
用图片的时候一定要小心的alloc和release
推荐使用
NSString *path = [[NSBundle mainBundle] pathForResource:@"icon" ofType:@"png"];
myImage = [UIImage imageWithContentsOfFile:path];
---------------------1-地图------------------------
//(1)创建MKMapView
//CGRect rect = CGRectMake(0, 0, 320, 460);
// supportMapView = [[MKMapView alloc] initWithFrame:rect];
//设定经纬度
CLLocationCoordinate2D theCoordinate;
theCoordinate.latitude=22.53705;
theCoordinate.longitude=114.08248;
//设定显示范围
// MKCoordinateSpan theSpan;
// theSpan.latitudeDelta=0.08;
// theSpan.longitudeDelta=0.08;
// //设置地图显示的中心及范围
// MKCoordinateRegion theRegion;
// theRegion.center=theCoordinate;
// theRegion.span=theSpan;
// //设置地图显示
// [supportMapView setMapType:MKMapTypeStandard];
// //[supportMapView setRegion:theRegion];
// [supportMapView setRegion:theRegion animated:YES];
// [supportMapView regionThatFits:theRegion];
//
// //(2)地图加标注
// SupportAnnotation *mapAnnotations=[[SupportAnnotation alloc] initWithCoordinate:theCoordinate];
// mapAnnotations.title ;
// mapAnnotations.subtitle
// [supportMapView addAnnotation:mapAnnotations];
// [mapAnnotations release];
//
// //
// [zoomOutButton setHidden:FALSE];
// [zoonInButton setHidden:TRUE];
// [zoomOutView setHidden:TRUE];
图片cache极有可能不会响应 memory warnings and release its objects:
用图片的时候一定要小心的alloc和release
推荐使用
NSString *path = [[NSBundle mainBundle] pathForResource:@"icon" ofType:@"png"];
myImage = [UIImage imageWithContentsOfFile:path];
---------------------1-地图------------------------
//(1)创建MKMapView
//CGRect rect = CGRectMake(0, 0, 320, 460);
// supportMapView = [[MKMapView alloc] initWithFrame:rect];
//设定经纬度
CLLocationCoordinate2D theCoordinate;
theCoordinate.latitude=22.53705;
theCoordinate.longitude=114.08248;
//设定显示范围
// MKCoordinateSpan theSpan;
// theSpan.latitudeDelta=0.08;
// theSpan.longitudeDelta=0.08;
// //设置地图显示的中心及范围
// MKCoordinateRegion theRegion;
// theRegion.center=theCoordinate;
// theRegion.span=theSpan;
// //设置地图显示
// [supportMapView setMapType:MKMapTypeStandard];
// //[supportMapView setRegion:theRegion];
// [supportMapView setRegion:theRegion animated:YES];
// [supportMapView regionThatFits:theRegion];
//
// //(2)地图加标注
// SupportAnnotation *mapAnnotations=[[SupportAnnotation alloc] initWithCoordinate:theCoordinate];
// mapAnnotations.title ;
// mapAnnotations.subtitle
// [supportMapView addAnnotation:mapAnnotations];
// [mapAnnotations release];
//
// //
// [zoomOutButton setHidden:FALSE];
// [zoonInButton setHidden:TRUE];
// [zoomOutView setHidden:TRUE];
相关文章推荐
- 不可错过的10个超棒jQuery表单操作代码片段
- 10 个实用的 jQuery 表单操作代码片段
- Gis操作代码片段
- 给sublime设置代码片段,快捷键,加快操作,pre快捷键
- 关于CSDN代码片段入口
- [转] c#有关winform的两个代码片段(多线程操作窗体控件与窗体淡入淡出效果)
- 代码片段,lucene基本操作(基于lucene4.10.2)
- 不可错过的10个超棒jQuery表单操作代码片段
- Excel 关于新建xls文件 新建sheet 合并sheet的VBA操作代码
- 关于代码操作AOT
- 10个超棒jQuery表单操作代码片段
- 关于操作字体的代码
- 关于U3D中一些物体显示的代码操作
- 一些关于链表操作的代码
- IOS[Swift版]常用操作代码片段
- 10个超棒jQuery表单操作代码片段
- 关于 Xcode 自己设置的可复用的 代码片段 Code Snippets
- c#有关winform的两个代码片段(多线程操作窗体控件与窗体淡入淡出效果)
- 推荐10个不错jQuery表单操作代码片段
- 关于利用js 操作Excel的代码