2014年8月20日

iOS多线程GCD

摘要: Grand Central Dispatch (GCD)是Apple开发的一个多核编程的解决方法。dispatch queue分成以下三种:1)运行在主线程的Main queue,通过dispatch_get_main_queue获取。/*!* @function dispatch_get_main... 阅读全文

posted @ 2014-08-20 14:27 李园春秋 阅读(130) 评论(0) 推荐(0) 编辑

判断ios版本

摘要: 在AppDelegate方法里,添加类方法+ (NSInteger)OSVersion;实现为+ (NSInteger)OSVersion{ static NSUInteger _deviceSystemMajorVersion = -1; static dispatch_once_t ... 阅读全文

posted @ 2014-08-20 11:10 李园春秋 阅读(174) 评论(0) 推荐(0) 编辑

DBL_EPSILON和 FLT_EPSILON的用法

摘要: DBL_EPSILON和 FLT_EPSILON主要用于单精度和双精度的比较当中: double a = 0.5; if (a == 0.5) { //正确 x++; } double b = sin(M_PI / 6.0); if (b == 0.5)... 阅读全文

posted @ 2014-08-20 10:47 李园春秋 阅读(4298) 评论(0) 推荐(0) 编辑

导航