I have tableView (A) responsible for listing items CoreData and viewController (B) to add new item. To create a ViewController (B) custom, they chose to use the following Present Modally to use presentation Over Current Context to enable transparent background and be able to apply the blur.
- From tableView (A) press the button to add a new item, the viewController (B) appears.
- Add a new item and saved in CoreData
- The viewController (B) execute
self.dismissViewControllerAnimated(true, completion: nil)
and the display returns to the tableView (B)
The problem is that the table view does not update the data.
Following a post from Stack Overflow resulting in code:
override func viewDidAppear(animated: Bool) {
self.loadData()
}
But at the back of viewController (B), nothing happens in Xcode does not pass the lines of viewDidAppear
.
Can anyone help me?
NSFetchedResultsController
to populate your tableView. If you use its delegate methods (there is boilerplate code in the Apple docs), it will automatically update the TV as soon as you add the new object. – TiaratibbettsNSFetchedResultsController
? – Neves