2015年12月25日

iOS 编码规范

摘要: iOS 编码规范地址:https://github.com/oa414/objc-zen-book-cn/ 阅读全文

posted @ 2015-12-25 11:02 卡丁车h 阅读(139) 评论(0) 推荐(0)

2015年12月20日

OC基础 点语法的使用

摘要: OC基础 点语法的使用1.创建一个Student类继承于NSObject,Student.h文件#import @interface Student : NSObject{ NSString *_name; NSString *_nickName;}//@property定义属性//1,... 阅读全文

posted @ 2015-12-20 23:04 卡丁车h 阅读(197) 评论(0) 推荐(0)

OC基础 可变字典与不可变字典的使用

摘要: OC基础 可变字典与不可变字典的使用1.不可变字典1.1创建不可变字典 //创建字典 //注意: //1,元素个数是偶数 //2,每两个元素是一个键值对 //3,值在前,键在后 NSDictionary *dic =... 阅读全文

posted @ 2015-12-20 22:53 卡丁车h 阅读(503) 评论(0) 推荐(0)

OC基础 可变数组与不可变数组的使用

摘要: OC基础 可变数组与不可变数组的使用1.不可变数组1.1不可变数组的创建 //实例方法 NSArray *array = [[NSArray alloc] initWithObjects:@"1",@"2",@"3", nil]; NSLog(@"%@",a... 阅读全文

posted @ 2015-12-20 22:38 卡丁车h 阅读(607) 评论(0) 推荐(0)

2015年12月1日

iOS之使用QLPreviewController打开文件,处理txt文件出现乱码的情况

摘要: iOS之使用QLPreviewController打开文件,处理txt文件出现乱码的情况主要代码:- (id )previewController:(QLPreviewController *)controller previewItemAtIndex:(NSInteger)index { /... 阅读全文

posted @ 2015-12-01 15:57 卡丁车h 阅读(1321) 评论(0) 推荐(0)

2015年11月13日

iOS之断点下载,使用NSURLSession简单封装

摘要: 最近公司需要做个文件管理的功能模块,刚交到博主手上时,头都大了。因为没做过这方面的东西,只好咬牙加班,并请教某位大神,指点了一下,清楚研究方向,找了网上大量资料,最后实现简单的封装。上代码:.h文件#import @interface DocDownloader : NSObject/** * 创... 阅读全文

posted @ 2015-11-13 16:50 卡丁车h 阅读(355) 评论(0) 推荐(0)

2015年10月13日

OC基础 单例

摘要: #undefAS_SINGLETON #defineAS_SINGLETON(__class)\ +(__class*)sharedInstance; #undefDEF_SINGLETON #defineDEF_SINGLETON(_... 阅读全文

posted @ 2015-10-13 16:40 卡丁车h 阅读(227) 评论(0) 推荐(0)

2015年9月29日

iOS 关于时间戳的一些细节

摘要: 最近遇到一个bug,在iPhone上获取当前的时间戳,没有问题,而用iPad来测试的时候,出现了时间戳不对。当时的代码 (需要精确到毫秒,所以*1000)NSTimeInterval t = [[NSDate date] timeIntervalSince1970]*1000;NSString *t... 阅读全文

posted @ 2015-09-29 14:10 卡丁车h 阅读(683) 评论(0) 推荐(0)

2015年9月18日

iOS RGB颜色封装

摘要: 使用类别创建.h文件#import @interface UIColor (HexColor)+ (UIColor *)colorWithHex:(NSString *)hex;@end.m文件#import "UIColor+HexColor.h"@implementation UIColor (... 阅读全文

posted @ 2015-09-18 11:49 卡丁车h 阅读(379) 评论(0) 推荐(0)

2015年9月10日

iOS 判断设备是否越狱

摘要: 我们在开发过程中,需要知道设备是否越狱,在网上查看很多资料,为此封装一些判断的方法。上代码,不解释:.h文件#import @interface JailBroken : NSObject/** * 1. 判定常见的越狱文件 */- (BOOL)isJailBrokenOne;/** * 2. ... 阅读全文

posted @ 2015-09-10 14:53 卡丁车h 阅读(490) 评论(0) 推荐(0)

导航