0

I have one summary page controller where I display all users from database file.

I'm using Core Data environment. In this page I have one button to delete all users from db. This is working fine but I'm not able to reflect those changes in current screen. I need to reload my view controller in order to reflect those changes on screen.

Here is what I do.

for (NSManagedObject * user in users) {
    [delegate.managedObjectContext deleteObject:user];
}

NSError *saveError = nil;
[delegate.managedObjectContext save:&saveError];

How to refresh my current screen?

Lorenzo B
  • 33,216
  • 24
  • 116
  • 190
BaSha
  • 2,356
  • 3
  • 21
  • 38
  • After deletion immediately again call or select database all values its automatically refresh your screen. – Vishal Dec 10 '12 at 11:57
  • i'v done all it in viewDeadLoad method...i tried to call it again after deletion from database, bt it is not working! – BaSha Dec 10 '12 at 12:34
  • Delete all objects from you datasource of the view controller and call `setNeedsDisplay` on the view. – dasdom Dec 10 '12 at 12:59
  • Provide some other details (and code). In particular, what do you mean with *I've done all it in viewDidLoad method*? Thanks. – Lorenzo B Dec 10 '12 at 22:38

0 Answers0