Core Data design question
Core Data design question
- Subject: Core Data design question
- From: John Timmer <email@hidden>
- Date: Tue, 03 May 2005 13:16:57 -0400
Quick question here:
I've got a series of NSManagedObjects and subclasses. Most of them have a
"notes" field holding RTF saved as NSData. I'd like to expose the text of
these notes to being searched by adding a method that makes an attributed
string out of the data and then extracts the raw string. The question is:
where do I put this method? I could:
Add a category to NSManagedObject with a "searchableNotes" method and trap
exceptions for when the "notes" key doesn't exist.
Subclass NSManagedObject, add the "searchableNotes" method, and make all the
objects with a "notes" key subclasses of this.
Assume that the "searchableNotes" method won't change, and just add it in to
any classes that need it.
I'm leaning towards the middle option since it seems the cleanest, but was
wondering if there were other reasons to favor one or another of these?
Thanks,
JT
_______________________________________________
This mind intentionally left blank
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden