
UIView 同時移動、旋轉、放大的作法
from http://servinggear.blogspot.tw/2012/02/uiview.html
zer931 發表在 痞客邦 留言(0) 人氣(59)
zer931 發表在 痞客邦 留言(0) 人氣(28)
initWithNibName 和 loadNibNamed 的区别
from http://www.cnblogs.com/ghj1976/archive/2012/05/28/2521840.html
UIViewController initWithNibName
这时候是延迟加载
主要代码如下:
ShowViewController * showMessage = [[ShowViewController alloc]
initWithNibName:@"ShowViewController" bundle:nil];
self.showViewController = showMessage;
[showMessage release];
这时候是延迟加载,这个View上的控件是 nil 的
self.showViewController.show_Topic
只有到 需要显示时,才会不是 nil
[saveViewController.view removeFromSuperview];
[self.view insertSubview:showViewController.view atIndex:0];
这时候 xib 文件的要求:
NSBundle loadNibNamed
实时加载。
这时候的代码:
NSArray * nib = [[NSBundle mainBundle] loadNibNamed:@"Save3ViewController"
owner:self options:nil] ;
self.showViewController = [nib lastObject];
这时候的xib文件
如果用 loadNibNamed 加载 initWithNibName 用到格式的 xib 文件,就会报错误:
setValue:forUndefinedKey
loaded the...nib but the view outlet was not set
loadNibNamed和initWithNibName需要加载的xib文件是不一样的。initWithNibName需要加载的xib文件的File Owner应改是需要加载的类,
而loadNibNamed需要加载的xib文件的File Owner为NSObject。
http://www.cnblogs.com/GoGoagg/archive/2011/06/09/2076456.html
when using loadNibNamed:owner:options:, the File's Owner should be NSObject, the main view should be your class type, and all outlets should be hooked up to the view, not the File's Owner.
http://stackoverflow.com/questions/46220/iphone-app-crashing-error-question
参考资料:
从xib/nib加载UIViewController/或其子类
http://www.cnblogs.com/GoGoagg/archive/2011/06/09/2076456.html
iPhone App Crashing - Error Question
http://stackoverflow.com/questions/46220/iphone-app-crashing-error-question
zer931 發表在 痞客邦 留言(0) 人氣(170)
[objective C] UIEdgeInsetsMake 拉伸操作的部分的大小
from http://hopeyoung1208.blogspot.tw/2012/02/objective-c-uiedgeinsetsmake.html
UIEdgeInsetsMake(0,0,0,0)指定了不進行拉伸操作的部分的大小,顺序是上、左、下、右4个边。
scrollView.contentInset = UIEdgeInsetsMake( 0.0f, 0.0f, 60.0f, 0.0f);
這樣就是往下拉的時後有60的間距,往上、左、右都沒有間距。
zer931 發表在 痞客邦 留言(0) 人氣(172)
UIImageJPEGRepresentation和UIImagePNGRepresentation
from http://www.helmsmansoft.com/index.php/archives/1706
在Iphone上有两种读取图片数据的简单方法: UIImageJPEGRepresentation和UIImagePNGRepresentation.
zer931 發表在 痞客邦 留言(0) 人氣(76)
zer931 發表在 痞客邦 留言(0) 人氣(679)
didSelectRowAtIndexPath event not triggered when select row programaticaly
from http://stackoverflow.com/questions/8705806/didselectrowatindexpath-event-not-triggered-when-select-row-programaticaly
zer931 發表在 痞客邦 留言(0) 人氣(70)
zer931 發表在 痞客邦 留言(0) 人氣(66)
OBJECTIVE C NULL定義
在程式裡
給與變數
zer931 發表在 痞客邦 留言(0) 人氣(58)
- (CGPoint)convertPoint:(CGPoint)point toView:(UIView *)view;
根据指定view参照物,转换点的坐标
比如在一个View上一个Button,在button上有个点,相对button的坐标知道了,想知道这个点在这个View上的坐标,就可以用这个API去转换
zer931 發表在 痞客邦 留言(0) 人氣(4)