代码改变世界

NSCalendar NSDateComponents

2016-07-07 20:41 by xiangjune, 165 阅读, 0 推荐, 收藏, 编辑
摘要:// NSCalendar // 获取当前日历 NSCalendar *calendar = [NSCalendar currentCalendar]; // 获取当前时间日期的各个值 NSDate *currentDate = [NSDate date]; NSUInteger unitFlag 阅读全文

IOS 谓词

2016-07-07 17:15 by xiangjune, 218 阅读, 0 推荐, 收藏, 编辑
摘要:// 谓词 Person *person = [[Person alloc]init]; person.name = @"zhang san"; person.age = 20; NSPredicate *predicate = [NSPredicate predicateWithFormat:@" 阅读全文

NSDate

2016-07-07 11:04 by xiangjune, 182 阅读, 0 推荐, 收藏, 编辑
摘要:// 获取当前的日期 NSDate *date1 = [NSDate date]; NSLog(@"data1 = %@", date1); // 获取三天前的日期 NSDate *date2 = [[NSDate alloc]initWithTimeIntervalSinceNow:-3*3600 阅读全文

IOS asc码替换

2016-06-20 15:13 by xiangjune, 520 阅读, 0 推荐, 收藏, 编辑
摘要:-(void)click:(UIButton *)btn { NSString *testStr = @"学>与全等"; NSStringEncoding encoding2 = NSUTF8StringEncoding; testStr = [testStr stringByReplacingOc 阅读全文

帝国CMS内容模板IF判断

2016-06-14 14:47 by xiangjune, 1129 阅读, 0 推荐, 收藏, 编辑
摘要:[e:loop={'selfinfo',50,0,0,"jingshu=$navinfor[jingshu]","id"}]<?php$class1="normal"; if($navinfor['id'] == $bqr['id']){ $class1="active";}?> <div clas 阅读全文

帝国CMS列表模板页面内容截取

2016-06-08 21:45 by xiangjune, 1795 阅读, 0 推荐, 收藏, 编辑
摘要:$listtemp = '<div class="c_n_item">';$listtemp .= '<div class="c_n_title"><a href="[!--titleurl--]" title="[!--class.name--],[!--title--]">[!--title-- 阅读全文

ios 获取崩溃日志

2016-04-15 16:59 by xiangjune, 324 阅读, 0 推荐, 收藏, 编辑
摘要:虽然有了try catch异常捕获,但是还是存在崩溃异常无法捕获到的。我可以通过下面的方式来获取崩溃日志: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)l 阅读全文

oc 正则图片<img /> 标签

2016-04-07 16:24 by xiangjune, 426 阅读, 0 推荐, 收藏, 编辑
摘要:-(NSString *)getImageAttributeValue:(NSString *)content attributeKey:(NSString *)key { NSString *regexString = [NSString stringWithFormat:@"%@=\\\"(.* 阅读全文

iOS-self.layer.shouldRasterize属性

2016-04-07 10:06 by xiangjune, 293 阅读, 0 推荐, 收藏, 编辑
摘要:当shouldRasterize设成true时,layer被渲染成一个bitmap,并缓存起来,等下次使用时不会再重新去渲染了。实现圆角本身就是在做颜色混合(blending),如果每次页面出来时都blending,消耗太大,这时shouldRasterize = yes,下次就只是简单的从渲染引擎 阅读全文

变量的定义及访问效率

2016-03-31 17:48 by xiangjune, 468 阅读, 0 推荐, 收藏, 编辑
摘要:按变量访问效率的优先级,建议按以下顺序来实现: 1.getter/setter 合成存取方法:使用:1.@property 定义属性 2._开头定义成员变量 这样做有助于提高效率 2.点语法:实质是调用getter/setter方法 3.KVC:1.调用getter/setter方法 2,若是没有g 阅读全文
上一页 1 ··· 3 4 5 6 7 8 9 10 11 12 下一页