re: core-data app design question
re: core-data app design question
- Subject: re: core-data app design question
- From: Ben Trumbull <email@hidden>
- Date: Sat, 29 Aug 2009 17:53:08 -0700
I have a question, or rather, I'm looking for advice, on the design of
an application. Essentially I'm wanting to write a labbook-type
application. My plan was to use core-data for the model. In the model
will be an Entry entity. Each entry will have a one-to-one
relationship to a Content entity. The Content entity will just (at the
moment) contain a single attribute (data) which will be binary data.
Implementing this on the Mac I planned to use NSTextView to provide a
rich-text entry for the data attribute. Now comes the problem. I want
to make a Cocoa Touch version of the app, and make then synchronize
over Mobile me. The problem is I see no way to handle the
NSAttributedString that will be stored in the data attribute on the
iPhone.
Does anyone have any advice as to how I might go about this? I was
considering dropping back to plain text, but am loath to do this.
Well, since you can't draw NSAttributedStrings on the iPhone, there
isn't much point in archiving your data that way. You should use a
platform neutral text run. You can write your own, which isn't hard
for basic attributes, or you can use HTML instead, which you can draw
on both platforms easily.
Encoding your data this way is pushing the boundaries of violating MVC
patterns by archiving UI information (NSTextView drawing information)
into your model (database). That obviously doesn't work if the
platform doesn't support NSTextView.
- Ben
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden