ios tableView加载cell时有延时的操作 比如反地理编码
来源:互联网 发布:淘宝服务市场怎么投诉 编辑:程序博客网 时间:2024/06/06 23:23
获取到数据之后
#pragma mark -- 获取狗狗设备信息列表- (void) getDogoptionalInfo { UserManager *manger = [UserManager getUserManager]; if ([manger checkIsLogined] == NO){ [self.dogEpumentInfoArr removeAllObjects]; return; } if (_logOutState == YES) { [self.dogEpumentInfoArr removeAllObjects]; [self.tableView reloadData]; return; } dispatch_async(dispatch_get_global_queue (DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ //获取狗狗列表 HttpRequest *request = [[HttpRequest alloc] init]; NSString *url = [HOMEDOGINFO_URL stringByAppendingString:[manger getToken]]; [request setStrUrl:url]; [request setCompletionBlockWithType:HttpTypeGet success:^(HttpResponse *response) { dispatch_async(dispatch_get_main_queue(), ^{ NSArray *arr = response.responseData; if ([arr isKindOfClass:[NSArray class]]) { [self.dogEpumentInfoArr removeAllObjects]; for (int i=0; i<arr.count; i++) { NSDictionary *dic = arr[i]; HomeDogInfoModel *info = [[HomeDogInfoModel alloc] initWithDictionary:dic error:nil]; if ((info.device != nil)||(info.device.length > 5)){ [self getlocationDetailName:info andIndex:i]; [self.dogEpumentInfoArr addObject:info]; } } } _netState = YES; [self.tableView reloadData]; }); } failure:^(HttpResponse *response) { if (self.dogEpumentInfoArr.count == 0) { if (response.stateCode == 0) { _netState = NO; [self.tableView reloadData]; } } }]; }); }
#pragma mark -- 根据经纬度获取当前地理位置- (void) getlocationDetailName:(HomeDogInfoModel *)model andIndex:(NSInteger)index { // dispatch_async(dispatch_get_global_queue (DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ CLGeocoder *geocoder = [[CLGeocoder alloc] init]; CLLocation *location=[[CLLocation alloc]initWithLatitude:model.latitude longitude:model.longitude]; [geocoder reverseGeocodeLocation:location completionHandler:^(NSArray *placemarks, NSError *error) { if (error||placemarks.count==0) { }else//编码成功 { for (CLPlacemark *placeMark in placemarks) { NSDictionary *addressDic=placeMark.addressDictionary; model.location = [[addressDic objectForKey:@"Name"] stringByAppendingString:@"附近"]; [self refishTablecell:index + 1]; } } }]; });}
阅读全文
0 0
- ios tableView加载cell时有延时的操作 比如反地理编码
- [iOS] 延时加载TableView中Cell中的图片
- IOS 延时加载TableView中Cell中的图片
- iOS反地理编码的坑
- iOS 地理编码和反地理编码
- ios地理编码 反地理编码
- ios-地理编码和反地理编码
- iOS--CoreLocation地理反地理编码
- 地理反编码的实现
- ios有关定位 ,地理编码,反地理编码;
- iOS 硬件 定位 - 地理编码和反地理编码
- iOS 原生地图地理编码与反地理编码
- iOS反地理编码,lbs定位
- ios百度地图定位反地理编码
- iOS 定位于地理反编码
- 地理编码/反地理编码
- Android 地图的地理编码与地理反编码
- ios的tableview的cell
- 数据库面试题总结
- 多态&多态对象模型
- XML解析之XPath解析
- HDU-6035 Colorful Tree(dfs序造树)
- 获取HiveConnection,及重现获取过程中的某些问题。
- ios tableView加载cell时有延时的操作 比如反地理编码
- Code obfuscation
- Const类
- RecyclerView的滑动到指定位置
- 找出数组出现次数超过一半的数
- Android开发——贝塞尔曲线解析
- Android应用防止模拟点击,防范抢红包类似插件的方法
- 智能家居2.0:智能音箱何以成为新的入口
- mybatis入门基础(六)----高级映射(一对一,一对多,多对多)