I am working on an app where it starts out at a tableViewController which loads and displays data stored in a Realm database. I have it so I can create a new entry in my Realm database in a separate scene and the save button unwind segues back to the initial tableView.
I current have it so the tableViewController will reload the tableView on pull down (something I Learned here, second answer down) but I would be better if the tableView would reload its self automatically upon unwind, displaying all the data in my database, including my new entry. Could someone please direct me to a tutorial that will teach me how this is done.
Additional info: My app is embedded in a navigation controller. The save button is located the bottom tool bar.
Try reloading your tabledata in
viewWillAppear
in initial (tableview)controller.Or call again the function through which you are loading your data from Realm like
You can use
NSNotification
for that.First of all in your
tableViewController
add this in yourviewDidLoad
method:And this will call one method from your class:
So add this method too.
Now in your next view controller where you add new data into data base add this in you
unWindSegue
function:Hope it will help
If you are using storyboard unwind segue, try using