문제

I'm working on a Multi-threaded application that uses Coredata.

When i save some data on one thread it goes to the database but when I try to fetch it from a different thread once the data is saved to the database, the fetch request returns the old data.

Any suggestions on how to fix this?

도움이 되었습니까?

해결책

This was an issue due to the MOC merge policy. I have used NSMergeByPropertyObjectTrumpMergePolicy earlier and switching to NSMergeByPropertyStoreTrumpMergePolicy fixed the issue. Keep in mind, this should be picked according to your need.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top