摘要: 做bzip2压缩的时候,偶然发现了gzip压缩和解压缩,这里把链接分享给大家,希望对大家有所帮助:http://stackoverflow.com/questions/8425012/is-there-a-practical-way-to-compress-nsdata/11389847#11389847代码如下:#import "zlib.h"// don't forget to add libz.1.2.x.dylib into your project-(NSData*)gzipInflate:(NSData*)data{if([data length]==0 阅读全文
posted @ 2014-04-09 10:17 zcb1989 阅读(273) 评论(0) 推荐(0) 编辑
摘要: 最近做项目遇到了个难题,项目中要用到数据压缩,和普通的文件的压缩和解压缩不同,这里直接对数据比如NSData ,NSString 等类型的数据进行压缩,遇到这个问题首先在网上找了好多文章,比如gitHub上,一开始我很快就找到了一片关于解压缩的代码,代码链接分享给大家 https://github.com/dingtianran/LibBzip2可是,这个例子支持解压缩,不支持数据压缩,那怎么办呢,又纠结了好长时间,后来终于找到了一篇文章就是针对解决这个问题的,把链接分享给大家:http://stackoverflow.com/questions/9577735/how-compress-da 阅读全文
posted @ 2014-04-09 10:11 zcb1989 阅读(1747) 评论(0) 推荐(1) 编辑
摘要: 最近闲来无事,把项目中用到的一些小得知识点总结出来分享给大家,这里主要说一下iOS中16进制和字符串之间的相互转换首先,介绍一下字符串转换成字符串,废话少说直接上代码:在 *.h 中:/*** @brief 字符串转换成16进制的字符** @param string 要转换的字符串** @return 返回得到的16进制字符串*/+ (NSString *)hexStringFromString:(NSString *)string;在 *.m 中:/*** @brief 字符串转换成16进制**/+ (NSString *)hexStringFromString:(NSString *).. 阅读全文
posted @ 2014-04-09 09:33 zcb1989 阅读(2069) 评论(0) 推荐(0) 编辑
摘要: 导航条push出来一个viewController ,推出来的ViewController上本来是显示返回的pop按钮的,现在想把这个推出来的视图控制器上的pop返回上一级的leftBarButtonItem隐藏掉,可是试了很长时间就是隐藏不掉,后来终于发现是放错位置了,应该把[self.navigationItem setHidesBackButton:YES];这句代码放在被推出来的那个视图控制器中的viewDidLoad中就可以了,希望能帮到大家。。。。。 阅读全文
posted @ 2014-01-22 17:05 zcb1989 阅读(725) 评论(0) 推荐(0) 编辑
摘要: 今天在网上看到一篇关于iOS7状态栏的文章,粘贴了过来分享给大家,希望对大家有所帮助。。。。。 标题:Developer’s Guide to the iOS 7 Status BarAmong the many visual changes in iOS 7, one of the most noticeable as a developer is the new status bar.In previous versions of iOS, the status bar was untouchable other than color adjustments. iOS 7 makes th 阅读全文
posted @ 2013-11-04 18:10 zcb1989 阅读(1096) 评论(0) 推荐(0) 编辑
摘要: 找了很久终于找到怎么解决了。。。。分享给大家。。。第一步:在Plist里面添加 UIViewControllerBasedStatusBarAppearance 设置为 :NO 第二步:在入口类中写:[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; 阅读全文
posted @ 2013-11-04 18:04 zcb1989 阅读(1674) 评论(0) 推荐(0) 编辑
摘要: 希望对大家有用。。。。。。 if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7){ [application setStatusBarStyle:UIStatusBarStyleLightContent]; self.window.clipsToBounds =YES; self.window.frame = CGRectMake(0,20,self.window.frame.size.width,self.window.frame.size.height-20);} 阅读全文
posted @ 2013-11-04 18:02 zcb1989 阅读(209) 评论(0) 推荐(0) 编辑