MISISIBI

感谢您使用 MISISIBI 客户端,如有任何问题都可以用以下方式联系我们:

公司(The company):Beijing Huajian Technology Co.,Ltd.

联系电话(Contact phone number):010-68882020

联系邮箱(Contact email):s@kingsbr.com

联系地址(Contact address):Fengtai District Beijing City China. 1003 apartment 4th TinganTongli 18

YYWebImage清除缓存

1
2
3
4
5
6
7
8
9

YYImageCache *cache = [YYWebImageManager sharedManager].cache;

float tmpSize = cache.diskCache.totalCost / 1024 /1024;

NSString *clearCacheName = tmpSize >= 1 ? [NSString stringWithFormat:@"清理缓存(%.2f M)",tmpSize] : [NSString stringWithFormat:@"清理缓存(%.2f K)",tmpSize * 1024];
[cache.memoryCache removeAllObjects];
[cache.diskCache removeAllObjects];
NSLog(@"%l@",[NSString stringWithFormat:@"已%@",clearCacheName]);

iOS开发-Apple Pay-苹果支付

前言 - 什么是Apple Pay

Apple Pay,是苹果公司在2014年苹果秋季新品发布会上发布的一种基于NFC(近场通讯)的手机支付功能,2016年2月18日凌晨5点,Apple Pay业务在中国上线。
它的支付方式是通过Touch ID/Passcode验证方式,用户可使用事先已经储存在IPhone 6 ,6p或者更新设备上的银行卡支付证书来授权支付,当然最新的5e,同样支持Apple Pay支付。
也就是说你的苹果设备要在IOS8.0及以上版本,并在wallet应用中,添加银行卡信息,从而使用Apple Pay。
它所支持的银行可以到官方查看,这里给出官方链接
手机怎么添加银行卡,这里不过多介绍,只需要按照手机提示即可。

//判断是否在中国
if(![LocationConverter isLocationOutOfChinaRay:[LocationConverter transformFromGCJToWGS:customLoc2D]])
{
NSLog(@”%@”,reGeocode.formattedAddress);
//查询逆地理编码成功
[ws.headMap setLocationInfo:reGeocode];
//模糊查询本地城市列表
CityInfo *searchInfo = [[CityInfo alloc]init];
if ([CommonHelp isBlankString:reGeocode.addressComponent.city] )
{
//城市名模糊查询
searchInfo.cityName = [NSString stringWithFormat:@”%@”,[reGeocode.addressComponent.province stringByReplacingOccurrencesOfString:@”市” withString:@””]];
}else
{
//城市名模糊查询
searchInfo.cityName = [NSString stringWithFormat:@”%@”,[reGeocode.addressComponent.city stringByReplacingOccurrencesOfString:@”市” withString:@””]];
}

    DatabaseManager *manager = [DatabaseManager sharedInstance];
    NSArray *cityArr = [manager queryCityWithInfo:searchInfo];
    CityInfo *resultInfo;
    if(cityArr.count >0)
    {
        resultInfo = cityArr[0];
    }

    [USDF setObject:resultInfo.adCode forKey:@"adCode"];
    [USDF setObject:reGeocode.formattedAddress forKey:@"currentPosition"];
    [USDF setObject:reGeocode.addressComponent.citycode forKey:@"citycode"];
    [USDF setObject:[NSString stringWithFormat:@"%f",location.coordinate.latitude] forKey:@"latitude"];
    [USDF setObject:[NSString stringWithFormat:@"%f",location.coordinate.longitude] forKey:@"longitude"];

    [ws requestListData];//获取数据
}else
{
    NSString * latlon= [NSString stringWithFormat:@"&lat=%f&lon=%f",location.coordinate.latitude,location.coordinate.longitude];
    AFHTTPSessionManager *session = [AFHTTPSessionManager manager];
    session.responseSerializer = [AFHTTPResponseSerializer serializer];
    //网络请求时间
    [session.requestSerializer willChangeValueForKey:@"timeoutInterval"];
    session.requestSerializer.timeoutInterval = 10;
    [session.requestSerializer didChangeValueForKey:@"timeoutInterval"];
    [session POST:[NSString stringWithFormat:@"http://nominatim.openstreetmap.org/reverse?zoom=10&addressdetails=1&format=json%@",latlon] parameters:nil progress:^(NSProgress * _Nonnull uploadProgress) {


    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {

        id result=[NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableContainers error:nil];
        NSLog(@"请求成功数据-->%@",result);
        NSDictionary * dic = [[NSDictionary alloc] initWithDictionary:[result objectForKey:@"address"]];
        NSString   * address = [dic objectForKey:@"city"];
        NSString * displayName = [NSString stringWithFormat:@"%@",[result objectForKey:@"display_name"]];
        [ws.headMap setLocationtext:displayName];

        //模糊查询本地城市列表
        CityInfo *searchInfo = [[CityInfo alloc]init];
        NSString * a = [NSString stringWithFormat:@"%@",[address stringByReplacingOccurrencesOfString:@"特别" withString:@""]];
        NSString * locatedAt = [NSString stringWithFormat:@"%@",[a stringByReplacingOccurrencesOfString:@"市" withString:@""]];
        //城市名模糊查询
        searchInfo.cityName = locatedAt;
        DatabaseManager *manager = [DatabaseManager sharedInstance];
        NSArray *cityArr = [manager queryCityWithInfo:searchInfo];
        CityInfo *resultInfo;
        if(cityArr.count >0)
        {
            resultInfo = cityArr[0];
        }
        [USDF setObject:resultInfo.adCode forKey:@"adCode"];
        [USDF setObject:displayName forKey:@"currentPosition"];
        [USDF setObject:resultInfo.adCode forKey:@"citycode"];
        [USDF setObject:[NSString stringWithFormat:@"%f",location.coordinate.latitude] forKey:@"latitude"];
        [USDF setObject:[NSString stringWithFormat:@"%f",location.coordinate.longitude] forKey:@"longitude"];

        [ws requestListData];//获取数据

    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {


        //NSLog(@"%@",error);

    }];

// [self.geocoder reverseGeocodeLocation: location completionHandler:
// ^(NSArray placemarks, NSError error) {
// if (error == nil) {
// // 系统反地理编码成功
// //得到自己当前最近的地名
// CLPlacemark placemark = [placemarks objectAtIndex:0];
// NSDictionary
dic = placemark.addressDictionary;
// NSString locatedAt = placemark.locality;
// NSString
ads=[NSString stringWithFormat:@”%@,%@”,placemark.name,placemark.locality];
// [ws.headMap setLocationtext:ads];
//
// //模糊查询本地城市列表
// CityInfo searchInfo = [[CityInfo alloc]init];
// //城市名模糊查询
// searchInfo.cityName = [NSString stringWithFormat:@”%@”,[locatedAt stringByReplacingOccurrencesOfString:@”市” withString:@””]];
// DatabaseManager
manager = [DatabaseManager sharedInstance];
// NSArray cityArr = [manager queryCityWithInfo:searchInfo];
// CityInfo
resultInfo;
// if(cityArr.count >0)
// {
// resultInfo = cityArr[0];
// }
// if(resultInfo.adCode == nil)
// {
// [USDF setObject:@”110000” forKey:@”adCode”];
// }else
// {
// [USDF setObject:resultInfo.adCode forKey:@”adCode”];
// }
//
// [USDF setObject:ads forKey:@”currentPosition”];
// [USDF setObject:placemark.postalCode forKey:@”citycode”];
// [USDF setObject:[NSString stringWithFormat:@”%f”,location.coordinate.latitude] forKey:@”latitude”];
// [USDF setObject:[NSString stringWithFormat:@”%f”,location.coordinate.longitude] forKey:@”longitude”];
//
// [ws requestListData];//获取数据
//
// } else {
// // 系统自带反地理编码失败,由 Google 接管。
// NSLog(@”123”);
// }
// }];
}

iOS开发-QRCode-二维码识别与生成

前言

有关二维码的介绍,我这里不做过多说明, 可以直接去基维百科查看,附上链接QR code.
IOS7之前,开发者进行扫码编程时,一般会借助第三方库。常用的是ZBarSDKaZXingObjC,IOS7之后,系统的AVMetadataObject类中,为我们提供了解析二维码的接口。经过测试,使用原生API扫描和处理的效率非常高,远远高于第三方库。

js(javascript)与OC(Objective-C)交互

前言

实质上oc与js的通信交互就是发送消息,也即函数调用,iOS7以后官方公布JavaScriptCore framework中很方便我们对他们之间的相互调用。在以前我们只能通过UIWebView的UIWebViewDelegate协议来实现.

1
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType;

或者

1
- (void)webViewDidStartLoad:(UIWebView *)webView;