http://www.mac-developer-network.com/columns/coredata/may2009/을 사용하여 다중 스레드/NSManagedObjectContexts를 사용하는 객체 가져 오기 기능을 작업하고 있습니다 (iPhone 용으로 개발 중임).명시 적 병합없이 한 NSManagedObjectContext에서 다른 NSManagedObjectContext로 변경 내용을 채우는 이유는 무엇입니까?
어떤 이유에서든 내 컨텍스트 중 하나를 저장하면 mergeChangesFromContextDidSaveNotification에 대한 호출을 주석 처리 했음에도 불구하고 다른 컨텍스트가 즉시 변경되어 업데이트됩니다. 컨텍스트가 명시 적 호출없이 서로 병합 될 수있는 이유가 있습니까? 여기
무슨 일이 일어나고 있는지에 대한 로그 : 당신이 볼 수 있듯이, 테스트 환경을 통해 중간 저장되고 주요 문맥이 갑자기 심지어 내가 천국 불구하고, 테스트 환경에서 새 개체가
// 1.) Main context is saved with "Peter Gabriel"
// 2.) Test context is created, begins with same contents as main context
// 3.) Main context is inserted with "Spoon"
// 4.) Test context is inserted with "Phoenix"
// Contents at this point:
CoreTest[4341:903] Artists in main context: (
"Peter Gabriel",
"Spoon"
)
CoreTest[4341:903] Artists in test context: (
"Peter Gabriel",
"Phoenix"
)
// 5.) testContext is saved
// New contents of contexts:
CoreTest[4341:903] Artists in main context: (
"Peter Gabriel",
"Phoenix",
"Spoon"
)
CoreTest[4341:903] Artists in test context: (
"Peter Gabriel",
"Phoenix"
)
전체 NSManagedObjectContextDidSaveNotification/mergeChangesFromContext 콤보를 수행하지 않았습니다.
내 이해는 명시 적으로 그렇게하지 않는 한 변경 사항이 병합되지 않는다는 것을 이해합니다 ... 여기에 무슨 일이 일어나는지 아는 사람이 있습니까?
의미가 있습니다 ... 수정 해 주셔서 감사합니다! –