I am using couchbase lite in my Mac app. I have a source list that displays categories in a tree data structure. Each category is an object that has a title and a children property that's a mutable array.
The model header looks something like this:
#import <CouchbaseLite/CouchbaseLite.h>
@interface SBCategory : CBLModel <NSPasteboardWriting, NSPasteboardReading>
@property(copy) NSString* uuid;
@property(copy) NSString* title;
@property(copy) NSDate* created_at;
@property(assign) BOOL isHeader;
@property (readonly, copy) NSMutableArray* children;
@end
I'm not using a nstreecontroller, just the array of objects mentioned above. I've really been wracking my brain as to how to store this in the database. Should I store each object individually? Should I try to serialize the whole structure to json and just store that? Should I be using a tree controller and does if offer helper methods for saving data? Advice on this is much appreciated. I'd really like to hear from some of the experts on SOF how they'd do this.