
Stayed up until 6 am doing major changes to the app. The character tab's outline view is now completely populated by bindings to an NSTreeController. What really made this work is transient properties in Core Data.
Looking at the picture above, I introduced two new entities; an abstract EVECDDisplayElement entity and an EVECDLearnedGroup entity. While instances of the latter are created and saved into the store, none of its fields are. I didn't want to overpopulate the store with redundant data. What makes this works o beautifully is how easy it is to bind everything via the learnedGroupsOrSkills key path. The actual code to generate these new learned group entities is less than 20 lines and execution time of it is near instantaneous.
From an MVC perspective, I see it somewhat of a compromise. Part of me tells me view related information shouldn't belong in the skeleton of the model. The real "model" is the store. The "skeleton" is the xcdatamodel file. Kind of hard to try to keep the terminology straight. On the plus side, however, I'm going to do a lot less worrying about KVC notifications and repopulating the table.
The other major change is how I'm locking the managed object context. Before, I figured using @synchronized did the job for me. In reality, I misunderstood its use and now use context's own lock and unlock methods.
Hopefully a beta release will be ready this weekend.
Edit: Err.. yeah, what picture?

No comments:
Post a Comment