我有跟随Profiler类和来自未知的reaseons我无法打印所有故障的故事。印刷文本包含我有关系的错误。
class StoryProfiler {
let storyId: NSManagedObjectID
init(storyId: NSManagedObjectID) {
self.storyId = storyId
}
func printToConsole() {
app().coreDataManager.container.performBackgroundTask { (ctx) in
ctx.retainsRegisteredObjects = true
let story = ctx.object(with: self.storyId) as! ModelStory
// fire all story faults recursively
_ = story.title
for cat in story.categories {
_ = cat.name
}
_ = story.listeningMode.name
for track in story.tracks {
for l in track.locations {
_ = l.startTime
}
}
print("BEGIN STORY PROFILER DUMP ====================")
print(story)
print("END STORY PROFILER DUMP ======================")
}
}
}
我认为我做的事情非常愚蠢,但我无法弄清楚为什么我会看到错误而不是物化关系对象。