- 博客(62)
- 收藏
- 关注
原创 iOS 脚本工具,自动执行 UnitTest 单元测试
适用范围:模拟器适用方法:1. 模拟器编译运行;2. 执行 xctool 运行[自动化测试应用](https://techbeacon.com/5-must-have-open-source-tools-ios-testing)xcodebuild -list #可以查看工程配置,workspace, project, schemexcodebuild -project [your project...
2018-06-13 20:30:11
994
原创 Ruby
Ruby常用部分集合Stringstring length str.lengthstring substring str[index] → new_str or nil click to toggle source str[start, length] → new_str or nil str[range] → new_str or nil str[rege
2017-08-27 21:08:26
405
原创 README
Ruby常用部分集合Array初始化: ary = [] ary = Array.new(3)取元素 e = ary[1] e = ary.first e = ary[-1]长度 ary.length ary.count空 ary.empty?包含? ary.include?('Konqueror')添加到尾部
2017-08-27 17:43:20
271
原创 performSelector mey leak
performSelector may cause a leak because its selector is unknown解决办法:1.SEL selector = NSSelectorFromString(@"someMethod");((void (*)(id, SEL))[_controller methodForSelector:selector])(_controller
2016-01-23 15:47:11
565
原创 navigation 系统自带交互手势
UINavigationController interactivePopGestureiOS7 之后,引入交互手势,在NavigationController 的交互手势是 UIScreenEdgePanGestureRecognizer, 继承自 UIPanGestureRecognizer。在本次交互手势启用中,遇到的问题自定义leftBarItem (返回按钮)不响应交
2015-11-19 18:05:37
657
原创 UINavigationViewController interactivePopGestureRecognizer
如何打开交互手势,在自定义返回按钮的情况下- (void)viewDidLoad { [super viewDidLoad]; if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) { self.navigationCont
2015-11-17 17:34:09
777
原创 event delivly 事件分发, 响应链
官方文档: 事件分发当用户触发一个点击屏幕的动作时, system 封装这个动作,为 UIEvent,然后传递給 正在使用的 app, 它传递給 window -》 寻找被点击到的view;流程就是 UIapplication - UIWindow - UIView (hit-test view) 也就是用户点击的view。hit-testing 也就是寻找点击view
2015-07-23 23:27:52
647
原创 ios MVC
首先,搞明白 MVC 是用来干嘛的?MVC 是一种设计模式,用来提升程序的可重用(reuse), 可扩展(extensible)。那么问题来了,怎么就提示重用了呢?任何的设计模式,都是基于一定的情景,MVC 的重用也不例外,比如,你定义一个FileHandleModel 来处理文件的读写改变,它可以在所所有文件读写相关的地方使用。如何扩展呢? 对单个 MVC 模型来扩展,可以有多个Mo
2015-07-22 17:32:14
750
原创 mysql,sqlite 联表查询 join
sqlite basemysql base基本从这2个里查看基础用法。讲解下,用到的 java mysql 中 join 用法:
2015-06-06 17:47:45
734
原创 reference cycle 引用循环
在swift 里引用循环的造成,主要有两个方法,1.类之间的引用2.clourse 闭包引用解决办法:weak references and unowned references. 也就是weak,unownedweak, 来修饰可选的,? 结尾的,如:var weak city: String ?unowned 来修身 一直存在的。 var unowned city: S
2015-05-19 14:42:33
1286
原创 [anyObject] 类型推断 Type Casting
在swift 中,如果遍历一个集合,可能就需要用到类型推断方式一:先把一个确定的集合进行推断,之后在遍历,适合单一的元素类型。 let constraints = self.constraints() as! [NSLayoutConstraint]; var item : NSLayoutConstraint? = nil; for constraint in
2015-05-18 11:31:45
946
原创 ios8 Adaptive UI
用到 class size 分两种:Regular,Compact Vertical Size ClassHorizontal Size ClassiPad PortraitRegularRegulariPad LandscapeRegularRegulariPhoneR
2015-05-14 18:21:17
545
原创 百度云推送问题 arm64
问题描述:Undefined symbols for architecture arm64: "_OBJC_CLASS_$_BPushClass", referenced from: objc-class-ref in libBPush.a(BPushStatisticsManager.o)ld: symbol(s) not found for architecture
2015-02-02 15:12:54
1762
原创 time difference for iOS
#define DAY_SECONDES 86400- (NSString *)dateTimeDifference:(NSString *)dateString{ NSDateFormatter *dateF = [[NSDateFormatter alloc] init]; [dateF setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; N
2014-02-25 10:01:11
811
转载 IOS 调用拨打电话
http://blog.youkuaiyun.com/favormm/article/details/6034952原链接大家想不想在自己的应用中拨打电话呀?打电话可以用openURL:这个API, 如:[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://10086"]];但是当电话结束后,返回
2013-11-07 16:23:44
7203
转载 适配IOS7
http://blog.youkuaiyun.com/ibcker/article/details/12115437参考 以上适配 IOS7
2013-10-31 10:26:00
645
转载 十六进制颜色对照表
http://www.ztyhome.com/android-color-16jinzhi/Android开发16进制颜色代码大全 AA 指定透明度。 00 是完全透明。 FF 是完全不透明。超出取值范围的值将被恢复为默认值。 ffff00ffff33ffff66ffff99ffffc
2013-10-29 15:43:20
43539
1
原创 自定义 bar
http://www.appcoda.com/ios-programming-how-to-customize-tab-bar-background-appearance/自定义 uitabbar
2013-10-29 13:07:46
598
原创 方法可用范围判断
思路:程序sdk与系统版本对比,来判断某个方法是否适用;1,根据系统版本#define IS_IOS_7 ([[[UIDevice currentDevice] systemVersion] floatValue] >6.9 ? YES:NO)2,根据方法判断 BOOL canRespond = [[UITabBarItem class] instancesR
2013-10-28 17:51:07
754
原创 数字格式化
在某些情况下,需要数字有一定的格式,如 123345.89 --》 123,345.89 这样的效果NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];[numberFormatter setNumberStyle:NSNumberFormatterDecimalStyle];NSString
2013-10-24 09:53:54
725
转载 16进制颜色
根据颜色的16进制,获得颜色#pragma mark - 颜色转换 IOS中十六进制的颜色转换为UIColor+ (UIColor *) colorWithHexString: (NSString *)color{ NSString *cString = [[color stringByTrimmingCharactersInSet:[NSCharacterSet whites
2013-10-21 16:40:51
648
原创 iOS NSMutableAttributedString/NSAttributedString 富文本设置
http://stackoverflow.com/questions/11031623/how-can-i-use-attributedtext-in-uilabel//UILabel 设置NSAttributedStringNSMutableParagraphStyle *ps = [[NSMutableParagraphStyle alloc] init]; [ps s
2013-10-17 16:26:48
61447
1
转载 iOS 字体
添加字体到应用中http://blog.youkuaiyun.com/justinjing0612/article/details/8093985
2013-10-17 13:48:17
681
转载 ios 绘图
core-graphicshttp://www.raywenderlich.com/tag/core-graphicscalayerhttp://www.raywenderlich.com/2502/calayers-tutorial-for-ios-introduction-to-calayers-tutorialrotary wheel(转盘)http:
2013-10-16 15:40:15
536
转载 MapKit 地图
参考 http://blog.youkuaiyun.com/pjk1129/article/details/7492166 1 地图显示区域定位 CLLocationCoordinate2D center = CLLocationCoordinate2DMake(31.228656,121.483383);//定义初始坐标点//显示区域调整 MKCoordinateRe
2013-10-10 10:23:36
680
转载 ajax timeout
ajax timeout对jQuery来说,超时可以直接设置timeout参数,并在error事件中捕获第二个参数,如果是“timeout”则表明捕获了超时事件,非常清楚。例子:$.ajax({ type: "POST", contentType: "application/json", url: "../ws/MyService.asmx/test", data:
2013-09-29 14:58:17
1864
转载 js加密
SJCL:斯坦福大学JS加密库斯坦福大学下载地址:http://crypto.stanford.edu/sjcl/sjcl.zip GitHub主页:http://github.com/bitwiseshiftleft/sjcl)
2013-09-28 11:41:47
660
原创 Mail 邮件发送
1.首先添加 MessageUI.framework 框架2. 引入框架 在类的头部 #import #import 3. 实现接口 - (void)handleDoubleTap:(UIGestureRecognizer *)doubleTap{ model.isShowUDID = !model.isShowUDID;
2013-09-28 11:20:33
792
原创 NSPredicate
//判断result 是 a,r,s 中的一个 返回yes,表示 包含, no, 表示不包含+ (BOOL)isHandel:(NSString *)result{ NSString *regex = @"[ARS]"; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",re
2013-09-27 14:56:06
538
转载 GCD
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ NSURL * url = [NSURL URLWithString:@"http://www.baidu.com"]; NSError * error; NSString * data =
2013-09-23 19:19:11
681
转载 JAVA array,map 转 json 字符串
Java代码 public class User { private String username; private String password; public String getUsername() { return username; } pub
2013-09-17 19:05:36
20798
转载 android真机调试
1、手机通过数据线连接在电脑上2、设置android手机为USB调试模式。步骤: menu—> 设置 —> 应用程序 —> 开发 , 选择【USB调试】3、如果是window系统,系统会提示安装驱动:选择正确的android sdk安装目录,然后点击下一步,系统就开始安装驱动了4、 驱动安装完成之后,重启电脑(通常系统会有“安装新驱动,重启才能生效”
2013-09-16 07:33:39
762
原创 cmd 跳转文件路径
跳转到指定文件目录下如果同一个盘就用cd 路径如 cd c:\11如果不同分区就用cd /d 盘符\11如 cd /d e:\11注:进入含有特殊字符目录时需要加引号 例如 cd "c:\program files"经测试,可用
2013-09-16 07:31:11
7313
2
原创 NSArray / NSMutArray 数组排序
在一个数组中,进行,多项元素的排序 [_dataList sortUsingComparator:^NSComparisonResult(id obj1, id obj2) { BOOL obj1isRead = [[obj1 objectAtIndex:2] boolValue]; BOOL obj2isRead = [[obj2 objectAtIndex:2]
2013-09-03 09:59:08
991
转载 iOS 获取版本信息
NSLog(@"uniqueIdentifier: %@", [[UIDevice currentDevice] uniqueIdentifier]); NSLog(@"name: %@", [[UIDevice currentDevice] name]); NSLog(@"systemName: %@", [[UIDevice currentDevice] systemNam
2013-08-30 11:45:38
822
原创 plist 转 json
+ (void)showJSON{ NSArray *arrayPlists = [[NSBundle mainBundle] pathsForResourcesOfType:@"plist" inDirectory:nil]; // NSLog(@"%@",arrayPlists); for (NSString *path in arrayPlists) {
2013-08-26 11:07:31
4846
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人