I would like to set this up: ** UINavigationController ** ** Core Data ** - RootView (Table of Courses-of-Study) - [CourseOfStudy entity] -- didSelectRowAtIndexPath --> DetailView -- [StudyMaterial entity](list of Qs) -- DetailView consists of: --- TextView (on top) --- [Question entity] --- TableView (on bottom, subview of DetailView) --- [Answers entity, Distractors entity] How do relate my courses of study directly with their respective/detail-view/child data? Thanks
答案 0 :(得分:1)
主/根表视图中的每一行都代表一个特定的CourseOfStudy
对象。当用户选择该行时,您将知道需要哪个CourseOfStudy
对象。在DetailView控制器中创建一个属性来保存CourseOfStudy
对象。在将DetailView控制器推送到NavigationController的堆栈之前,请将该属性设置为所选的CourseOfStudy
对象。
......你已经完成了。 DetailView控制器现在具有正确的CourseOfStudy
对象,并且可以显示它的属性。