CocoaDev

Edit AllPages

Hi, all. I have an application that has several different kinds of entities. They represent different objects in a project. I have a list of project members that I want to display in an outline view. I don’t want to support manual drag order, but I do want to be able to accept things like images, text files, etc. To do this, I imagine that, on accept/drop, I’d create the appropriate entity (“Illustration” for image drops, etc.) and the outline view would do the right thing.

My question is twofold:


October 11 2005

I’ve given up trying to represent this all in one outline view, since each type will have its own properties represented in differing columns. I’ve since created a view that contains an outline view for each of the major object types I’ll be representing, all in one scroll view. Any time any of their bounds change, I tile them with my own custom routine. It works quite nicely. Now my objective has changed. Concentrating only on one entity:

I have an entity called “Entry” and one called “Folder”. The relationship is: Folder <–» Entry. In ONE outline view I’d like to represent all the folders and entries. The problem I’m trying to wrap my head around is this: I want an entry to appear as a root object if it has no parent folder, so the outline view must represent folders and entries. I thought about making Folder and Entry both have a common abstract parent like “Container” but I don’t want Entry instances to contain anything (ie, an entry cannot contain an entry or a folder). Just Folder instances. :-/ So how do I represent this?


Just like a filesystem. Make a root folder that contains everything, then display its contents. Any root object has this special root folder as its parent. The user doesn’t need to know about the root folder at all if you only show what’s in it. –JediKnil