上一页 1 ··· 3 4 5 6 7 8 9 下一页
摘要: 以前对于为什么在viewDidUnload将property设为nil就可以将内存释放防止内存泄漏感到疑惑.今天看文档的时候终于想明白了.首先我们来看一个例子:1 @interface Counter : NSObject 2 {3 NSNumber *_count;4 }5 @property (nonatomic, retain) NSNumber *count;6 @end;count property的access method 相当于下面两个methods: 1 - (NSNumber *)count 2 { 3 return _count; 4 } 5 6 - (... 阅读全文
posted @ 2012-02-26 17:25 woainilsr 阅读(442) 评论(1) 推荐(0)
摘要: For a detached nib file, the actual loading of the nib file occurs automatically when theviewproperty of the view controller object is accessed and the view is not currently in memory. The defaultloadViewmethod uses thenibNameandnibBundleproperties to locate the desired nib file and load its content 阅读全文
posted @ 2012-02-26 17:11 woainilsr 阅读(207) 评论(0) 推荐(0)
摘要: You Don’t Own Objects Returned by ReferenceSome methods in Cocoa specify that an object is returned by reference (that is, they take an argument of type ClassName** or id*). A common pattern is to use an NSError object that contains information about an error if one occurs, as illustrated by initWit 阅读全文
posted @ 2012-02-26 14:02 woainilsr 阅读(8135) 评论(0) 推荐(0)
摘要: UITextView has square edges, and looks ugly compared to a UITextField!Unfortunately, there isn’t an option to give the UITextView a nice border. There are various ways to do this, such as creating your own background image for the UITextView, but I have found a relatively easy way to do it – and one 阅读全文
posted @ 2012-02-26 12:33 woainilsr 阅读(560) 评论(0) 推荐(0)
摘要: 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 阅读(489) 评论(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 阅读(541) 评论(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 阅读(5711) 评论(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 阅读(210) 评论(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 阅读(5479) 评论(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 阅读(2754) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 下一页