lonelysoul

Happy share, happy life.

导航

2013年12月4日 #

好好学习,天天向上

摘要: 知识的重要性是毫无疑问的,从前一直都是在半学半玩的状态中度过,也就造成了自己啥都知道一点,但也可以说啥都不会。自己没有聪明的头脑,如果还不努力的话,拿什么去实现自己的理想?每天都需要做一点什么,无论学习啥,都应该学着,每天都应该有所进步。我知道自己不聪明,也许努力了也达不到那种厉害的层级、到不了让人们敬佩的境界,但我还是希望自己要多努力一些,就要平凡一点,就是自己。To learn everything in my life.(我英语不太好,很多文档都看不太懂,只有把遇到的生词记下来,我相信日积月累会有所突破) 阅读全文

posted @ 2013-12-04 14:29 lonelysoul 阅读(169) 评论(0) 推荐(0) 编辑

2013年12月2日 #

iOS7中UITableView问题以及UITableViewCell的层级关系

摘要: 最近在对项目进行iOS7.0的适配,今天遇到两个大问题:1、UITableView的顶部有一大片空白处,如下图:表格的y坐标是64,但是却又一片空白,查了资料http://segmentfault.com/q/1010000000319086看到发现原来iOS7的viewController新增了一个属性automaticallyAdjustsScrollViewInsets,在viewDidLoad加上这句话,// #define IS_IOS7 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0000 ? YES 阅读全文

posted @ 2013-12-02 19:52 lonelysoul 阅读(1470) 评论(0) 推荐(1) 编辑

2013年11月29日 #

iOS中打乱数组的顺序

摘要: 实现NSMutableArray的分类,NSMutableArray+Shuffling.h@interface NSMutableArray (Shuffling)- (void)shuffle;@endNSMutableArray+Shuffling.m@implementation NSMutableArray (Shuffling)- (void)shuffle{ static BOOL seeded = NO; if(!seeded) { seeded = YES; srandom(time(NULL)); } NSUInt... 阅读全文

posted @ 2013-11-29 14:50 lonelysoul 阅读(333) 评论(0) 推荐(0) 编辑

2013年11月25日 #

(转)使用CFStringTransform将汉字转换为拼音

摘要: 原文出自这里CFStringTransformiOS在CoreFoundation中提供了CFStringTransform函数,但在Foundation中却没有相对应的方法。它的定义如下:Boolean CFStringTransform(CFMutableStringRef string, CFRange *range, CFStringRef transform, Boolean reverse);其中string参数是要转换的string,比如要转换的中文,同时它是mutable的,因此也直接作为最终转换后的字符串。range是要转换的范围,同时输出转换后改变的范围,如果为NULL,视 阅读全文

posted @ 2013-11-25 17:56 lonelysoul 阅读(337) 评论(0) 推荐(0) 编辑

2013年11月23日 #

专心学习

摘要: 用心学习,多用心,多思考,多专研。少玩,少点其他活动。 阅读全文

posted @ 2013-11-23 00:22 lonelysoul 阅读(131) 评论(0) 推荐(0) 编辑

2013年11月18日 #

iOS开发中的遇到的一些小技术缩短开发周期(持续收集)

摘要: 1、用UIColor做成UIImage,我现在用于iOS7的UIButton上,扁平化风格:+ (UIImage *)imageWithColor:(UIColor *)color{ CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f); UIGraphicsBeginImageContext(rect.size); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetFillColorWithColor(context, [color C... 阅读全文

posted @ 2013-11-18 22:49 lonelysoul 阅读(262) 评论(0) 推荐(0) 编辑

2013年11月16日 #

如何做iOS7的简单适配(还原iOS6的状态栏和导航栏)

摘要: 第一步:在plist里增加2个内容:View controller-based status bar appearance : NOStatus bar style : Opaque black style第二步:在appdelegate里让windows下移20像素if ([[[UIDevice currentDevice] systemVersion] floatValue] > = 7) { self.window.frame = CGRectMake(0,20,self.window.frame.size.width,self.window.frame.size.height-2 阅读全文

posted @ 2013-11-16 10:53 lonelysoul 阅读(195) 评论(0) 推荐(0) 编辑

2013年11月15日 #

iOS中用正则表达式找出匹配的内容

摘要: // regularExpress:正则表达式 desString:被查找的字符串+ (NSString *)matchRegularExpress:(NSString *)regularExpress andDesString:(NSString *)desString{ NSError *error; NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:regularExpress options:0 error:&error]; if (regex != n... 阅读全文

posted @ 2013-11-15 19:21 lonelysoul 阅读(800) 评论(0) 推荐(0) 编辑

Linux命令删除某目录下的所有.svn文件

摘要: find .-type d -name ".svn"|xargs rm -rf或者find . -type d -iname ".svn" -exec rm -rf {} \;祝您愉快开心 ^_^ 阅读全文

posted @ 2013-11-15 17:13 lonelysoul 阅读(287) 评论(0) 推荐(0) 编辑

2013年11月9日 #

iOS——二进制转十进制

摘要: 留着用的到的时候用!! 阅读全文

posted @ 2013-11-09 19:58 lonelysoul 阅读(182) 评论(0) 推荐(0) 编辑