I am trying to set dynamic height of table. But it is not working when I log height of table it is showing me dynamic height but not set to actual table.
Here is my code
I think there must be some other code change your tableView's frame.
Use KVO to detect change of the frame of UITableView.
1、add an observer to it in you viewDidLoad method
[table_sender addObserver:self forKeyPath:@"frame" options:NSKeyValueObservingOptionNew|NSKeyValueObservingOptionOld context:nil] ;
2、implement observeValueForKeyPath method and add an breakpoint in it. When the breakpoint stop, check the call stack to find who change the frame.
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
if ([keyPath isEqualToString:@"frame"]) {
NSLog(@"%@", change) ; // add an breakpoint here
} else {
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context] ;
}
}