摘要:
googlecode里面很多优秀的开源代码,其中一些完整的产品项目对于我们iOS个人开发者来说很有参考价值.下面分享一下从googlecode中check out source code 的方法1、google code的网址是 http://code.google.com/hosting/2、找到所想下载的代码后,到source里找到 svn checkout http://5dice.googlecode.com/svn/trunk/ 5dice-read-only 这样的字段3、打开终端 输入如下命令: 1) cd Desktop //这个是切换到桌面 2) sudo mkdir 5di 阅读全文
posted @ 2012-02-25 20:21
woainilsr
阅读(486)
评论(0)
推荐(0)
摘要:
1 time_t convertTimeStamp(NSString *stringTime) 2 { 3 time_t createdAt; 4 struct tm created; 5 time_t now; 6 time(&now); 7 8 if (stringTime) { 9 if (strptime([stringTime UTF8String], "%a %b %d %H:%M:%S %z %Y", &created) == NULL) {10 strptime([stringTime ... 阅读全文
posted @ 2012-02-25 19:40
woainilsr
阅读(539)
评论(0)
推荐(0)
摘要:
时间日期格式化符号:%y 两位数的年份表示(00-99)%Y 四位数的年份表示(000-9999)%m 月份(01-12)%d 月内中的一天(0-31)%H 24小时制小时数(0-23)%I 12小时制小时数(01-12)%M 分钟数(00=59)%S 秒(00-59)%a 本地简化星期名称%A 本地完整星期名称%b 本地简化的月份名称%B 本地完整的月份名称%c 本地相应的日期表示和时间表示%j 年内的一天(001-366)%p 本地A.M.或P.M.的等价符%U 一年中的星期数(00-53)星期天为星期的开始%w 星期(0-6),星期天为星期的开始%W 一年中的星期数(00-53)星期一为 阅读全文
posted @ 2012-02-25 19:20
woainilsr
阅读(5705)
评论(0)
推荐(0)
摘要:
UTF8String 这个方法将NSString转为C语言中以'\0'结尾的字符串. Returns a null-terminated UTF8 representation of the receiver. - (const char *)UTF8String Return Value A null-terminated UTF8 representation of the receiver. Discussion The returned C string is automatically freed just as a returned object... 阅读全文
posted @ 2012-02-25 19:19
woainilsr
阅读(207)
评论(0)
推荐(0)
摘要:
函数原型:char *asctime(const struct tm *tblock);功能说明:将tm结构类型时间日期转换为ASCII码。头文件:参数说明:语法:asctime[必要参数]必要参数的具体说明如下:tblock:待转换的时间指针,tblock为一tm结构型指针。返回值:返回由tm结构中的日期和时间转换成的字符串的地址,该字符串的形式定义如下:DDD MMM dd hh:mm:ss YYYY各字符的意义:DDD一星期的某一天,如MonMMM月份,如Jandd月中一天(1,2,……,31)hh小时(1,2,……,24)mm分钟(1,2,……,59)ss秒数(1,2,……,59)YY 阅读全文
posted @ 2012-02-25 18:57
woainilsr
阅读(5474)
评论(0)
推荐(0)
摘要:
包含文件:#ifndef__TIME_T#define__TIME_T /*避免重复定义time_t*/typedef long time_t; /*时间值time_t 为长整型的别名*/#endif既然time_t实际上是长整型,到未来的某一天,从一个时间点(一般是1970年1月1日0时0分0秒)到那时的秒数(即日历时间)超出了长整形所能表示的数的范围怎么办?对time_t数据类型的值来说,它所表示的时间不能晚于2038年1月18日19时14分07秒。为了能够表示更久远的时间,一些编译器厂商引入了64位甚至更长的整形数来保存日历时间。比如微软在Visual C++中采用了__time64_t 阅读全文
posted @ 2012-02-25 18:50
woainilsr
阅读(2752)
评论(0)
推荐(0)
摘要:
1 struct tm { 2 int tm_sec; /* seconds */ 3 int tm_min; /* minutes */ 4 int tm_hour; /* hours */ 5 int tm_mday; /* day of the month */ 6 int tm_mon; /* month */ 7 ... 阅读全文
posted @ 2012-02-25 18:49
woainilsr
阅读(7643)
评论(0)
推荐(0)
摘要:
①使用gmtime函数或localtime函数将time_t类型的时间日期转换为struct tm类型:使用time函数返回的是一个long值,该值对用户的意义不大,一般不能根据其值确定具体的年、月、日等数据。gmtime函数可以方便的对time_t类型数据进行转换,将其转换为tm结构的数据方便数据阅读。gmtime函数的原型如下:struct tm *gmtime(time_t *timep);localtime函数的原型如下:struct tm *localtime(time_t *timep);将参数timep所指的time_t类型信息转换成实际所使用的时间日期表示方法,将结果返回到结构 阅读全文
posted @ 2012-02-25 18:43
woainilsr
阅读(746)
评论(0)
推荐(0)
摘要:
1 NSString *src = @"<a href="http://weibo.com" rel="nofollow">新浪微博</a>" 2 NSRange r=[src rangeOfString:@"<a href"]; 3 if (r.location!=NSNotFound) { 4 5 NSRange start=[src rangeOfString:@"<a href=\""]; 6 if (start.location!=NSNo 阅读全文
posted @ 2012-02-25 18:13
woainilsr
阅读(404)
评论(0)
推荐(0)