Moved database loading to viewWillAppear method instead of viewDidLoad