UITableViewcell和IBAction

时间:2011-03-30 13:35:10

标签: iphone

我有一个班级:@interface MyClass :UITableViewCell ...我宣布了一个 - (IBAction)myMethod ......

在我的课程实施中,我想:

-(IBAction)myMethod:(id)sender
{
    MyOtherController *cont = [MyOtherController alloc]initWithNibName:...];

我想要它,这样当我点击我的按钮时,我会看到我的新视图(MyOtherController的视图), 请问你是怎么做到的?

2 个答案:

答案 0 :(得分:1)

您可能想要使用

[newViewController presentModalViewController] 

[self.navigationController pushViewController:newViewController animated:YES]

答案 1 :(得分:0)

只需为该按钮按下事件编写一个函数来加载另一个视图。