2014年2月27日

博客迁移

摘要: RT,博客迁移至:[http://iiwgh.com](http://iiwgh.com) 阅读全文

posted @ 2014-02-27 11:19 黯夜曦 阅读(106) 评论(0) 推荐(0) 编辑

2013年6月9日

关于CoreData的一个工具Mogenerator的使用

摘要: 最近看到用CoreData时使用的工具Mogenerator,发现网上介绍其具体使用的不多,特此简单整理一下,关于CoreData这里就不具体说了,使用就用MagicalRecord,用起来真是太方便了。关于Mogenerator MagicalRecord是一个命令行工具,通过项目里的.xcdatamodel文件(.xcdatamodeld里面右键点击显示包内容),可以为每个entity生成 两个类,第一个是machine文件_MyEntity,会同步你的data model,第二个是human文件MyEntity,它就是你在代码中#import操作类。你不需要修改machine和hu... 阅读全文

posted @ 2013-06-09 09:43 黯夜曦 阅读(521) 评论(0) 推荐(0) 编辑

2013年2月23日

判断NSString是NSInteger还是float?

摘要: 方法很多,无意间在Stack Overflow到此方法特此标记:就是用NSNumber处理 NSNumber* n = //from somewhere if(strcmp([n objCType],@encode(float))==0) { NSLog(@"this is a float"); }else if(strcmp([n objCType],@encode(int))==0) { NSLog(@"this is an int"); } 阅读全文

posted @ 2013-02-23 17:22 黯夜曦 阅读(230) 评论(0) 推荐(0) 编辑

2013年1月25日

移除项目里的所有.svn命令

摘要: RT,在终端里切换到项目文件夹,执行命令:find . -type d -name ".svn"|xargs rm -rf 阅读全文

posted @ 2013-01-25 09:18 黯夜曦 阅读(163) 评论(0) 推荐(0) 编辑

2013年1月4日

判断是否支持Retina Display

摘要: + (BOOL) isRetinaDisplay{ int scale = 1.0; UIScreen *screen = [UIScreen mainScreen]; if([screen respondsToSelector:@selector(scale)]) scale = screen.scale; if(scale == 2.0f) return YES; else return NO;} 阅读全文

posted @ 2013-01-04 11:16 黯夜曦 阅读(215) 评论(0) 推荐(0) 编辑

2012年12月18日

让 UITableView 的 headerView跟随 cell一起滚动

摘要: //The way I solved this problem is to adjust the contentOffset according to the contentInset in the //UITableViewControllerDelegate (extends UIScrollViewDelegate) like this: - (void)scrollViewDidScroll:(UIScrollView *)scrollView { CGFloat sectionHeaderHeight = 40; if (scrollView.contentOffse... 阅读全文

posted @ 2012-12-18 11:02 黯夜曦 阅读(552) 评论(0) 推荐(0) 编辑

2012年12月12日

iOS 6.0 下 在输入中文时 按下锁屏键 导致的闪退问题

摘要: - (void)applicationDidEnterBackground:(UIApplication *)application { UIDevice * device = [UIDevice currentDevice]; BOOL backgroundSupported = NO; if ([device respondsToSelector:@selector(isMultitaskingSupported)]) { backgroundSupported = device.multitaskingSupported; } __blo... 阅读全文

posted @ 2012-12-12 09:56 黯夜曦 阅读(181) 评论(0) 推荐(0) 编辑

2012年10月9日

统计xcode项目代码行数

摘要: 标记:打开终端,切换到项目目录,输入命令find . "(" -name "*.m" -or -name "*.mm" -or -name "*.cpp" -or -name "*.h" -or -name "*.rss" ")" -print | xargs wc -l 就可以得到项目的总代码行数。 阅读全文

posted @ 2012-10-09 08:09 黯夜曦 阅读(265) 评论(0) 推荐(0) 编辑

2012年8月30日

推荐iOS模拟器截图工具iOS-Simulator Cropper

摘要: 截取模拟器图的方法很多,以前接图就直接control+command+c,今天试了一下iOS-Simulator Cropper真的更强大,更方便,以前没发现,真是out了!软件使用很简单:iOS-Simulator Cropper最新版下载地址:http://www.curioustimes.de/iphonesimulatorcropper/ 阅读全文

posted @ 2012-08-30 15:26 黯夜曦 阅读(1155) 评论(0) 推荐(0) 编辑

如何让IOS应用从容地崩溃

摘要: 摘自:http://www.cocoachina.com/newbie/tutorial/2012/0829/4672.html虽然大家都不愿意看到程序崩溃,但可能崩溃是每个应用必须面对的现实,既然崩溃已经发生,无法阻挡了,那我们就让它崩也崩得淡定点吧。IOS SDK中提供了一个现成的函数 NSSetUncaughtExceptionHandler 用来做异常处理,但功能非常有限,而引起崩溃的大多数原因如:内存访问错误,重复释放等错误就无能为力了,因为这种错误它抛出的是Signal,所以必须要专门做Signal处理。在didFinishLaunchingWithOptions 中,加入代码如下 阅读全文

posted @ 2012-08-30 08:21 黯夜曦 阅读(230) 评论(0) 推荐(0) 编辑

导航