Re: Saving ruler markers to defaults
Re: Saving ruler markers to defaults
- Subject: Re: Saving ruler markers to defaults
- From: Sherm Pendley <email@hidden>
- Date: Sat, 17 Aug 2002 15:09:58 -0400
On Saturday, August 17, 2002, at 07:50 AM, Jeremy Dronfield wrote:
Thanks, but no, what I want to save is the state of the tab markers on
the ruler.
Based on your description, it sounds to me as if tab stops, etc., are
indeed properties of your document, and should therefore be stored along
with it rather than in defaults.
I recall reading somewhere, but I forget where at the moment, that the
user defaults database is intended to store a relatively small database
of application settings, and the large number of entries that storing
document settings could potentially generate can have a drastic effect
on its performance.
AppKit extends the basic NSAttributedString class with, among other
things, support for ruler attributes, so storing such with your document
shouldn't be too difficult if you're storing text in RTF format. What's
more, other applications that can import RTF should be able to read and
handle such attributes if they're stored within the document.
Yes, I know. According to the class docs, -rulerMarkersForTextView:
returns an array, which, if documentation and experience don't deal me
a doody, can be set as an object in user defaults. Or can't it in this
case?
Yes, an NSArray is a property list, and can be stored in user defaults -
if and only if all of the objects stored within the array can also be
stored. In this case, the array returned is of NSRulerMarkers, which are
not property lists.
sherm--
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.