我已经在一个独立的类中创建了一个自定义的uitableviewcell,并在uitableview中的viewcontroller中使用它。现在我想通过点击我的自定义uitableviewcell中的按钮来导航用户到另一个页面。有人可以帮帮我吗?定制uitableviewcell中的导航
以下是我的按钮点击动作的代码中的UITableViewCell:
-(IBAction)followUser:(id)sender {
NSLog(@"memberid %d",self.memberid);
profileViewController *profile = [[profileViewController alloc] init];
[((UIViewController*) sender).navigationController pushViewController:profile animated:FALSE];
}
但它崩溃。
sender实际上是我添加了tableview的视图控制器。 tableview有自定义的tableview单元格,这些单元格的这个按钮就是我的代码被调用的那个按钮。所以你的答案不会成立,因为UIButton不存在于UIViewcontroller上,而是存在于UITableviewCell上。 – pankaj 2012-04-03 09:25:43