从UIView的子类中推入视图控制器

创建了一个视图CategoryTableView,继承UIView。CategoryTableView包含了一个UITableView。我将CategoryTableView 作为子类添加到HomeViewController 中,HomeViewController 是UIViewController的子类。目前,我需要在didSelectRowAtIndexPath 执行时推入一个新的controller。但是在CategoryTableView中怎么推入或显示另一个视图控制器?

不能在CategoryTableView去导航控制器。

CategoryTableView.h

@property (retain, nonatomic) parentViewController *parent; //create one property for parent view like this

CategoryTableView.m

@sythesize parent;

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [parent.navigationController . . .]; // preform action
    //OR..
    [parent presentModalViewController: . . .]; // present modal view
}

parent.m

//while calling your CategoryTableView assign self to your parent object

    CategoryTableView *tblView = [CategoryTableView alloc] init];
    tblView.parent = self;