• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
mr.programmer
博客园 | 首页 | 新随笔 | 新文章 | 联系 | 订阅 订阅 | 管理

2013年12月13日

ios地图和定位学习五《经纬度和address的转换》
摘要: 要想实现通过经纬度获取地址名称,或者通过地址名称获得经纬度,我们要用到一下几个类:CLLocation CLGrocoder CLPlacemark经纬度转换成地址名称:CLLocation *location = [[CLLocation alloc] initWithLatitude:+38.4112810 longitude:-122.8409780];self.myGeocoder = [[CLGeocoder alloc] init];[self.myGeocoder reverseGeocodeLocation:location ... 阅读全文
posted @ 2013-12-13 09:56 mr.programmer 阅读(501) 评论(0) 推荐(1)
 
 

2013年12月12日

ios地图和定位学习四《获取当前位置的location》
摘要: 通过CLLocationManager类可以获取到当前位置的经纬度:1.要包含头文件2.添加CLLocationManagerDelegate协议3.在下面这个函数中:- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocationnewLocation.coordinate.latitude 当前位置的经度newLocation.coordinate.longitude 当前位置... 阅读全文
posted @ 2013-12-12 19:27 mr.programmer 阅读(244) 评论(0) 推荐(0)
 
ios地图和定位学习三《包含pinpoint的mapview》
摘要: 特定location的pinpoint实际上是一个ui,对应着一个名为MKAnnotation的protocal,需要声明三个属性:经纬度坐标coordinate,标题title,以及子标题subtitle。1.我们定义一个MyAnnotation的类去为存储pinpoint所需的属性,即coordinate,title,subtitle MyAnnotation.h文件:#import #import @interface MyAnnotation : NSObject @property (nonatomic, readonly) CLLocationCoordinate2D coordi 阅读全文
posted @ 2013-12-12 16:09 mr.programmer 阅读(183) 评论(0) 推荐(0)
 
ios地图和定位学习二《map view的创建》
摘要: ios通过MKMapView来显示地图,需要添加头文件1.创建一个ViewController,在其中添加一个MKMapView用来显示地图#import #import @interface mapViewController : UIViewController@property (nonatomic, strong) MKMapView* myMapView; //显示地图的控件@end2.在viewDidLoad中进行初始化,同时添加到当前view中- (void)viewDidLoad{ [super viewDidLoad]; // Do any additio... 阅读全文
posted @ 2013-12-12 15:44 mr.programmer 阅读(266) 评论(0) 推荐(0)
 
ios地图和定位学习一《framework框架的添加》
摘要: 需要使用到Core Location 和Map Kit框架,添加方式如下:1.点击xcode中的工程icon2.选择"Build Phases"----"Link Binary With Libraries"----"+"号3.在弹出的frameworks框中选择MapKit.framework和CoreLocation.framework,选择完成之后在Link Binary With Libraries中将会出现这两个framework:完成之后,只需要在相关的文件中添加: #import #import 即可 阅读全文
posted @ 2013-12-12 15:24 mr.programmer 阅读(211) 评论(0) 推荐(0)
 
 

2013年12月5日

ARC的strong/weak/unsafe_unretain的区别
摘要: strong,weak和unsafe_unretain都是用来描述属性的存储特性的。下面通过实例来介绍一下他们的区别:strong:@property (nonatomic, strong) NSString* string1;@property (nonatomic, strong) NSString* string2;self.string1 = @"string1";self.string2 = self.string1;self.string1 = nil;NSLog(@"string 2 = %@",self.string2);显示结果: st 阅读全文
posted @ 2013-12-05 14:44 mr.programmer 阅读(359) 评论(0) 推荐(0)
 
 

2013年12月4日

UITextField的使用总结
摘要: 1.UITextField的初始化和设置: UITextField* field = [[UITextField alloc] initWithFrame:CGRectMake(x, y, length, width)]; //初始化textfield的位置大小 field.placeholder = @"defaule"; //默认textfield中的文字 field.secureTextEntry = YES; //textfield中是密码的形式 field.clearButtonMode = UITextFieldViewModeWhi... 阅读全文
posted @ 2013-12-04 16:25 mr.programmer 阅读(133) 评论(0) 推荐(0)
 
 

2013年11月21日

UITableViewCell的重用机制
摘要: 在UITableView中,如果对每一行数据都单独分配一个独立的cell,那么对于有成百上千个cell的tableview中肯定会占用大量内存。为了解决内存耗费的问题,UITableView通过重用cell来节省内存。 以下是我个人对UITableViewCell重用机制的理解,如有不对的地方,希望大家能指出,帮助我不断修正: UITableView维护着两个队列,一个是当前可视的cell队列visiableCells,一个是可重用的cell队列reusableTableCells。 假设我们共有100个cell提供展示,但是一屏最多只能提供10个cell进行展示。在最初,reu... 阅读全文
posted @ 2013-11-21 20:31 mr.programmer 阅读(505) 评论(0) 推荐(0)
 
ios的AppDelegate和UIViewController的函数调用顺序
摘要: ios的AppDelegate和UIViewController的函数调用顺序1.AppDelegate: 测试方法:在工程自动生成的函数中添加NSLog函数,打印函数的执行顺序 点击进入app: 1. didFinishLaunchingWithOptions 程序开始 2. applicationDidBecomeActive 程序已经被激活 点击home键,app进入后台: 3. applicationWillResignActive 程序进入暂停状态 4. applicationDidEnterBackground ... 阅读全文
posted @ 2013-11-21 16:35 mr.programmer 阅读(857) 评论(0) 推荐(0)
 
 

公告


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3