摘要:
以前对于为什么在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)