iOS7动态更改UITableView高度

ser*_*991 8 objective-c uitableview ios

请帮我提一下这个问题.我尝试了所有可以在这里找到的选择.

附上我的代码示例(我知道,它非常糟糕).
如何UITableView动态更改高度?

- (void)viewDidLoad 
{
    [super viewDidLoad];
    [self vozvratmassiva];
}

- (NSMutableArray *) vozvratmassiva
{
 ...
    return array;
}

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

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    NSArray *a = [self vozvratmassiva];
    return a.count;
}

-(UITableViewCell *)tableView:(UITableView *) tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    ....
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 
{
     ....
    return commonsize;
}

@end
Run Code Online (Sandbox Code Playgroud)

xoa*_*ail -3

要更改单元格高度:

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
return commonsize;
}
Run Code Online (Sandbox Code Playgroud)

要更改 tableView 高度:

tableView.size.height = 100;
Run Code Online (Sandbox Code Playgroud)