4
在我viewDidLoad中,我寫了這個代碼:的UIButton在tableFooterView不響應點擊事件
UIView *footerView = [[[UIView alloc] initWithFrame:CGRectZero] autorelease];
UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
btn.frame = CGRectMake(10,10, 300, 40);
[btn setTitle:@"Select" forState:UIControlStateNormal];
[btn addTarget:self action:@selector(onClickSelect:) forControlEvents:UIControlEventTouchUpInside];
[footerView addSubview:btn];
myTableView.tableFooterView = footerView;
和我選擇的方法是:
- (void) onClickSelect: (UIButton*) sender
{
NSLog(@"selext");
}
但是當我點擊按鈕(這是我已添加在表格頁腳視圖中),選擇器方法不會被調用。有誰知道可能是什麼問題?
雅,得到了它。非常感謝。還有一件事,你的名字(EXE_BAD_ACCESS)太好了。 :):D – anshul
@anshul謝謝:) –