共 12 篇文章 |
|
百度地图 删除 覆盖物 removeOverlay removeOverlays 阅4 转自玄冰优 公众公开 17-03-14 13:51 |
结论过渡:如果对象收到alloc消息只在虚拟内存分配空间,那么persistent bytes(堆)里是不会分配给XOModel大小的,也就是说这里的persistent bytes大小应该是0。++i) { // 修改处 XOModel *model = [XOModel alloc]; // 注意这句只有alloc [self.array addObject:model]; }}When allocating any small blocks of memory, remem... 阅26 转0 评0 公众公开 16-06-28 09:51 |
iOS 9 NEHotspotHelper 的NetworkExtension使用。+ (BOOL)registerWithOptions:(NSDictionary*)options queue:(dispatch_queue_t)queue handler:(NEHotspotHelperHandler)handler.BOOL returnType = [NEHotspotHelper registerWithOptions:options queue:queue handler: ^(NEHotspotHelperCommand * cmd) {NSLog(@"cmd %@", cmd);NSL... 阅571 转2 评0 公众公开 16-05-13 18:29 |
我采用了UITextField作为我的输入框控件,并且在委托方法:-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)rangereplacementString:(NSString *)string中实现了对字符串的长度限制,实现如下:#define kMaxLength20-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)ran... 阅135 转4 评0 公众公开 16-05-10 15:34 |
NSDate NSCalendar(日历立法) NSDateComponents(日期组件)的一些用法。NSDateComponents *comps = [[NSDateComponents alloc] init];NSCalendar *gregorian = [[NSCalendar alloc]NSDate* startDate = [ [ NSDate alloc] init ];NSDateComponents *cps = [chineseClendar components:unitFlags fromDate:startDate toDate:toDate options:0... 阅115 转0 评0 公众公开 16-03-31 15:39 |
a 主线程的runloop自动创建,子线程的runloop默认不创建(在子线程中调用NSRunLoop *runloop = [NSRunLoop currentRunLoop];获取RunLoop对象的时候,就会创建RunLoop);Runloop有两个关键判断点,一个是通过msg决定Runloop是否等待,一个是通过判断退出条件来决定Runloop是否循环。常驻子线程,保持子线程一直处理事件为了保证线程长期运转,... 阅28 转0 评0 公众公开 16-03-30 18:06 |
iOS 3D Touch (UIApplicationShortcutItem、UIViewControllerPreviewing、UIPreviewAction)} - (void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL))completionHandler { // react to shortcut item selections NS... 阅288 转1 评0 公众公开 16-03-29 15:59 |
阅329 转0 评0 公众公开 16-03-29 15:56 |
定位标注自己的位置 自定义大头针 反地理编码等用的是系统的mapview,因返回的是火星坐标,在进行反地理编码时出现偏差,用网上的一些坐标转换发现还是不准确,无奈只能引入高德地图的AMapSearch进行反地理编码。mapview = [[MKMapView alloc]initWithFrame:self.[mapview setCenterCoordinate:mapview.// MKMapPoint point2 = MKMapPointFor... 阅626 转1 评0 公众公开 16-03-29 15:48 |
阅490 转0 评0 公众公开 16-03-29 15:26 |