摘要: 1.最常见的原因是 contentSize 这个属性,比uiscrollview的frame要小, 无需滚动, 自然就滚动不了。 scrollenabled 这个属性,标识着是否允许滚动,要言设成yes另外还有一些比较隐蔽的原因. 如果这个scrollView是在IB里面生成的话,还得手动设置它的contentSize,并且不能在initWithNibName:bundle:里面设置,因为The nib file you specify is not loaded right away. It is loaded the first time the view controller’s v.. 阅读全文
posted @ 2012-02-26 18:27 woainilsr 阅读(22368) 评论(0) 推荐(0)
摘要: the View Management CycleThe steps that occur during the load cycle are as follows:Some part of your application asks for the view in the view controller’sviewproperty.If the view is not currently in memory, the view controller calls itsloadViewmethod.TheloadViewmethod does one of the following:If y 阅读全文
posted @ 2012-02-26 17:49 woainilsr 阅读(376) 评论(0) 推荐(0)
摘要: 以前对于为什么在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)