title: How to save data from another view controller and reload tableview?
body: <p>I'm making an expense tracking app. I have added a table view in the main view controller, and added an &quot;add&quot; button in the navigation controller. On clicking this, it shows a view controller in which you type in the data.
  On clicking add at the end, it should save the entered data through coreData, and then be presented in the tableView, but my app crashes saying that a nil value was found, even though I have integrated the &quot;??&quot; safe guard.<a href="https://i.stack.imgur.com/dJNse.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dJNse.jpg" alt="&quot;The add view controller&quot;" /></a><a href="https://i.stack.imgur.com/fqwVg.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fqwVg.jpg" alt="The main View controller" /></a>&quot;</p>