Objective c 原型CellView中的TableView不';不反应

Objective c 原型CellView中的TableView不';不反应,objective-c,ios,uitableview,Objective C,Ios,Uitableview,我有个问题。。。不明白为什么 我有一个故事板,只有一个UIViewController,它有一个UITableView(插座)。UITableView有一个带有自定义类的原型单元(Outlet)。 这个自定义类/这个原型单元有一个UITableView(Outlet),但是最后一个tableView没有出现,没有反应,没有做任何事情。。。不明白为什么,IB中的链接还可以 以下是我的项目: 这是控制UITableView的代码,UITableView不会做出反应: #import "Cell.h

我有个问题。。。不明白为什么

我有一个故事板,只有一个UIViewController,它有一个UITableView(插座)。UITableView有一个带有自定义类的原型单元(Outlet)。 这个自定义类/这个原型单元有一个UITableView(Outlet),但是最后一个tableView没有出现,没有反应,没有做任何事情。。。不明白为什么,IB中的链接还可以

以下是我的项目:

这是控制UITableView的代码,UITableView不会做出反应:

#import "Cell.h"

@implementation Cell
@synthesize tableViewForCell;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self.contentView.layer setBorderColor:[UIColor grayColor].CGColor];
        [self.contentView.layer setBorderWidth:1.0f];
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 3;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"hours"];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"hours"];
    }
    return cell;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 30;
    //return  CGSizeMake(rect.size.width/X, rect.size.height/5);
}

我刚下载了你的项目并检查了一下。我不能简单地回答你的问题。你完全做错了。您有一个带有原型单元格的tableview,并且在这个原型单元格中添加了另一个tableview,它不是单元格

如果需要自定义tableview的单元格,请按照本教程进行操作


希望这能有所帮助。

您设置了单元格内Tableview的委托/数据源了吗?不要让您“做错了”为什么我不能将Tableview添加到单元格中。。嗯,我想我做得和你说的相反