【原创】Xcode中多离线文档及多版本模拟器
摘要:离线文档将Docset下载下来查阅才是最方便的,这里记录一下如何实现离线文档(而且是多版本文档),步骤如下1. 进入菜单 - Preference - Downloads - Documentation(这里看到我已经下载过了)2. 找到Feed: http://developer.apple.com/rss/com.apple.adc.documentation.AppleiPhone6.1.atom ,也就是该文档完整地址的url,打开之3.在打开的网页中会发现一个xar文件的下载链接(其实有很多个,找最新的就是了),用下载工具下载它4. 按照我上面截图的路径,先将xar文件放到/User
阅读全文
posted @
2013-06-30 16:14
chenxi_tales
阅读(408)
推荐(0)
【原创】GCD编程 - 2
摘要:上一篇讲了一下GCD的基本用法,这一篇稍微升华一下,说说关于GCD编程中‘同步’的那些事儿。先看一下原型:-(void) asyncMethodForPrint:(NSString *) ch{ NSLog(@"asyncMethodForPrint[%@]", ch);}-(void) test{ NSArray *arr = [NSArray arrayWithObjects:@"a",@"b",@"c",@"d",@"e",@"f",@"g
阅读全文
posted @
2013-06-25 19:58
chenxi_tales
阅读(510)
推荐(1)
【原创】GCD编程 - 1
摘要:概述直观上理解,GCD偏向于系统级的API,也就是说它更接近于底层,在编写规范的前提下它相较NSOperation的性能要略优。而Cocoa的异步框架即NSOperation相关提供的API,更偏向于应用层面,它是对系统底层调用(包括GCD等)的封装,从功能层面上讲相较GCD更为丰富(NSOperation + Queue的形式具备一些GCD未直接包含的功能)通过查阅官方文档以及国外一些Blog的阐述,基本达成的共识是:在APP中,尽可能的使用Cocoa,即high-level Api,除非在实际性能测试数据上发现不得不用更底层的api的时候,才进一步考虑使用GCD。而目前国内的开发者,大多数
阅读全文
posted @
2013-06-23 15:56
chenxi_tales
阅读(686)
推荐(0)
【原创】开源中国阅读小记 - 3 - TableCell图片异步加载
摘要:首先看TableView获取cell实例的方法- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath涉及Cell实例化的代码:PostCell *cell = (PostCell *)[tableView dequeueReusableCellWithIdentifier:PostCellIdentifier]; if (!cell) { // loadNib 方式加载n...
阅读全文
posted @
2013-06-20 19:16
chenxi_tales
阅读(604)
推荐(1)
【原创】开源中国阅读小记 - 2 - 单例
摘要:上一篇后面提到DataSingleton是一个单例,看一下具体的源码:#pragma 单例模式定义static DataSingleton * instance = nil;+(DataSingleton *) Instance{ @synchronized(self) { if(nil == instance) { [self new]; } } return instance;}+(id)allocWithZone:(NSZone *)zone{ @synchronized(self) { ...
阅读全文
posted @
2013-06-19 17:30
chenxi_tales
阅读(372)
推荐(1)
【原创】开源中国阅读小记 - 1
摘要:可能后续会写几篇关于阅读开源中国客户端源码的一些收获。1. 预编译文件oschina-Prefix.pch***-Prefix.pch 该文件可以理解为整个工程的公共头文件,往里添加一些不常变的库或者宏定义,可以提升编译效率。#ifndef __IPHONE_4_0#warning "This project uses features only available in iOS SDK 4.0 and later."#endif#ifdef __OBJC__ #import #import #import #import //添加的预编译#import "ASI
阅读全文
posted @
2013-06-19 17:29
chenxi_tales
阅读(312)
推荐(1)