Reputation: 615
I have object with name Coctail
and his relationship(many-to-many) with name Tag
.
I want to get object Coctail
from database (I use NSFetchedResultsController
) and print his tags. But when I try get tags like this 'coctail.tags' I get this
Relationship 'tags' fault on managed object...
Also when I try to get counts of tags ('coctail.tags.count') I get 0.
I don't know what code you need.
Upvotes: 1
Views: 220
Reputation: 615
You need to update the persistent properties of Coctail
object to use latest values from the persistent store. To do this, you need use refresh(_ object: NSManagedObject, mergeChanges flag: Bool)
method with true
flag.
Upvotes: 1