iphone开发点滴

- (void) start:(id)sender

{

UIButton * charButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];

[self.view addSubview:charButton];

[charButton release];//这里会导致crash。不应该release

}

+++++++++++++
UIViewController只是一个controller,是看不见的。
UIView才是可见的。
+++++++++++++

The rule for this is that you program in the UIView class and not in the UIViewController class


All members and children of the UIResponder class, including UIView, respond to touches.


++++++
Please note that when you add a category method that duplicates an existing method
signature, the Objective-C runtime uses your implementation and overrides the original.


+++++++++++++++++++

forwardInvocation:.This method only
gets called when an object has been unable to handle a message

+++++++++++++

performSelector:withObject:afterDelay:

Invokes a method of the receiver on the current thread using the default mode after a delay.


notificationcenter的通知会跨线程吗?

 与线程无关


+++++++++++++++++


TableView 性能问题讨论

However, if the content of a cell is composed of more than three or four subviews, scrolling performance might suffer. In this case (and especially if the cell is not editable), consider drawing directly in one subview of the cell’s content view. The gist of this guideline is that, when implementing custom table-view cells, be aware that there is a tradeoff between optimal scrolling performance and optimal editing or reordering performance.
使用 drawInRect 来提高性能
滚动卡的主要原因在于 a cell 的 subview 太多了


+++++++

UILongPressGestureRecognizer * longPressGR = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)];

longPressGR.minimumPressDuration = 0.1;  // 这里设太长比如为1会导致无法捕捉长按事件

[self.contentView addGestureRecognizer:longPressGR];

[longPressGR release];


++++++++++++++


在xib里font size勾选了adjust to fit后,导致程序里无法设font的大小。不选则可以。


+++++++++++++++


uiwebview无法检测到touchBegan等事件。 明显是程序有bug



+++++++++++++++++++

xcoder  配svn


选中项目名。

SCM->Configure SCM For This Project...->右上角点击Configure Roots & SCM...->选中你刚才创建的Repository


+++++++++++++++++++++


按钮RoundRectButton无法隐藏边框,type改为custom即可


++++++++++


NSString *wording = [NSString stringWithFormat:@"wording('%@')", NSLocalizedString(@"Load More", nil)];

[self.webView stringByEvaluatingJavaScriptFromString:wording];

这里执行js不返回null但页面元素没有变化,是因为页面的元素还没load好。推迟到load好后再执行即可


++++++++++++++

UIScrollView的setContentOffset会导致滚动,– scrollViewDidScroll:被触发


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值