Inside the MINoteProtocol what's the relationship between:
- (NSString *)noteString;
- (NSData *)noteRTFD;
- (NSTextStorage *)noteTextStorage;
are they used simultaneously or as alternatvies to one another?
Thanks,
Jeff
|
|
MINoteProtocol
Submitted by BMEguy on Tue, 2006-07-04 03:31.
Tags ( Plugin Development )
Inside the MINoteProtocol what's the relationship between: - (NSString *)noteString; are they used simultaneously or as alternatvies to one another? Thanks, Editing an entry's noteSubmitted by BMEguy on Tue, 2007-05-08 02:36.
Is the proper way to edit an entry's note through its textstorage? I have a NSMutableString *newRecord that I prepend to an entry's note field. Currently I used the code below, but when I "check and repair" the notebook, I often get a repair for a difference between the note string and RFTD string listed in the console. Should I be using a different method to change the note?
Thanks |
It's a little tricky. In the
It's a little tricky. In the database Mori saves the note string (so that it can be searched), and it saves the noteRTFD data that stores the note string plus all kinds of extra things like attachments and text attributes. The only reason that a copy of the string is saved separately is for searching purposes.
So the noteString method returns the noteString that's stored in the database. And the noteRTFD metod returns the noteRTFD data that's stored in the database.
And last comes:
- (NSTextStorage *)noteTextStorage;
that returns the "edit buffer" for the note. This might contain the same information that's in the database or it might contain edits of that info that haven't yet been saved to the database.
Hope that helps.