Automatically adjust the height of UITableView
according to Contents Dynamically.
I tried the following solution but didn't work for me:
dispatch_async(dispatch_get_main_queue()) {
//This code will run in the main thread:
CGRect frame = self.tableView.frame;
frame.size.height = self.tableView.contentSize.height;
self.tableView.frame = frame;
}