摘要: /** 在主线程执行block */ + (void)gs_synExecuteOnMainThread:(void (^)(void))block { if ((nil == block) || (NULL == block)) { return; } if ([NSThread isMainTh 阅读全文
posted @ 2019-04-22 21:06 kawerd 阅读(3847) 评论(0) 推荐(0) 编辑
摘要: // 得到当前本地时间,13位,整形 + (long long)gs_getCurrentTimeToMilliSecond { double currentTime = [[NSDate date] timeIntervalSince1970] * 1000; long long iTime = 阅读全文
posted @ 2019-04-22 21:05 kawerd 阅读(10593) 评论(0) 推荐(0) 编辑
摘要: //将字典转换成json格式字符串,不含\n这些符号 + (NSString *)gs_jsonStringCompactFormatForDictionary:(NSDictionary *)dicJson { if (![dicJson isKindOfClass:[NSDictionary c 阅读全文
posted @ 2019-04-22 21:03 kawerd 阅读(10896) 评论(0) 推荐(0) 编辑
摘要: /** 递归查找当前显示的VC*/ + (UIViewController *)recursiveFindCurrentShowViewControllerFromViewController:(UIViewController *)fromVC { if ([fromVC isKindOfClas 阅读全文
posted @ 2019-04-22 21:00 kawerd 阅读(2017) 评论(0) 推荐(0) 编辑
摘要: 1、简单判断是否是iPad方法 /** 判断是不是iPad*/ + (BOOL)isiPadDevice { return UIUserInterfaceIdiomPad == [UIDevice currentDevice].userInterfaceIdiom; } 2、复杂的获取详细设备信息 阅读全文
posted @ 2019-04-22 20:54 kawerd 阅读(448) 评论(0) 推荐(0) 编辑
摘要: 今天给大家分享zip解压到指定目录 首先需要下载ZipArchive文件 下载地址:https://pan.baidu.com/s/1S6qYicoVr3M3hI0M1EW2Bw 将下载的文件导入工程 传入文件目录 filePath 与 目标解压路劲 targetDir /** 将问将解压缩到制定目 阅读全文
posted @ 2019-04-22 20:47 kawerd 阅读(3346) 评论(0) 推荐(0) 编辑
摘要: 1、将NSData转换成Dictionary /** 将二进制数据转换成字典*/ + (NSDictionary *)dictionaryForJsonData:(NSData *)jsonData { if (![jsonData isKindOfClass:[NSData class]] || 阅读全文
posted @ 2019-04-22 20:37 kawerd 阅读(6137) 评论(0) 推荐(0) 编辑
摘要: 我们经常有下载文件上的需求 为了安全我们经常需要对文件进行md5校验 那我就来给大家分享一个很方便的获取文件md5值得方法。 首先需要引用系统库文件 #include <CommonCrypto/CommonDigest.h> /** 获取文件的md5值*/ + (NSString *)getFil 阅读全文
posted @ 2019-04-22 20:34 kawerd 阅读(3209) 评论(0) 推荐(0) 编辑
摘要: 一、常用的路径方法 1.获取AppName.app 目录路径: NSString *path = [[NSBundle mainBundle] bundlePath]; 2.获取Documents目录路径的方法: NSString *documentPath = NSSearchPathForDir 阅读全文
posted @ 2019-04-22 20:32 kawerd 阅读(937) 评论(0) 推荐(0) 编辑