I have UITableView and I have set height of tableview to 308. For each cell, they are of size 154 as shown in screenshots.

Now when I run this and I have 3 rows in UITableView. I was expecting to remain height as 308 only and expecting to have scrolling option. On scrolling I will see row 3 also, however UITableView is behaving differently. It is taking whole screen as shown below.

If you see, I can see third row and height of the row is increased.
To adjust height if tableview, I added below code in viewWillAppear,
mainTableView.frame = CGRectMake(mainTableView.frame.origin.x, mainTableView.frame.origin.y, 320, 308);
When I run this first time, I see all three rows. WHen I try to add and comes back to Home screen, I now see two rows only. But the problem is when I scroll, it crashes.
Crash says
Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 5 beyond bounds [0 .. 4]'
But this is not actual problem. If this is problem, then it should have also been crashed when I go to HomeViewController for the first time.
Any suggestion how should I solve this UITableView problem?