hodge
hodge

Reputation: 31

Iphone - managedobjectcontext not properly saving

Any idea why

    //should save the object context.
NSError *error;
if (![managedObjectContext save:&error]) {
    NSLog(@"SAVE ERROR");
}

when implemented in a view controller(accessed via a drill down tableview) won't properly save the information? I am passing the moc from the beginning (rootview hands off to tableview, tableview recursively passes it to itself until calls uiview) and any additions I do show up in the table if I pop/push the tableview(unfortunately reloadData in viewWillAppear doesn't want to update it).

Should I be passing the managedObject instead and fetching the context from that?

Upvotes: 1

Views: 550

Answers (1)

hodge
hodge

Reputation: 31

Since I was manually creating the sqlite entries in the code on load, I was also manually deleting it in the persistentStoreCoordinator each time the program started. Unfortunately, I forgot about that aspect.

Upvotes: 2

Related Questions