• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Saving ruler markers to defaults
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Saving ruler markers to defaults


  • Subject: Re: Saving ruler markers to defaults
  • From: Douglas Davidson <email@hidden>
  • Date: Fri, 16 Aug 2002 10:32:40 -0700

On Friday, August 16, 2002, at 10:04 AM, Jeremy Dronfield wrote:

Can anyone tell me how to save the ruler markers in an NSTextView to user defaults? I'm trying to use -rulerMarkersForTextView: but trawling the docs has left me unenlightened as to how to fill all the arguments:

[prefs setObject:[myLayoutManager rulerMarkersForTextView:myTextView paragraphStyle:???? ruler:????] forKey:@"Tabs"];

Let me suggest that what you actually want to save may not be the state of the ruler, but the state of the text. Ordinarily the ruler, markers, and accessories for an NSTextView are merely a reflection of the paragraph style for the current selection. It is probably the paragraph style, or some portion of it, that you actually want to save.

In any case, however, you cannot simply set an arbitrary object as a default; defaults must be property lists. There are at least two ways to do this: you can produce a parsable representation of the object in question, or you can archive it. A search of the list archives should produce many examples of both techniques, for example in the case of colors.

Douglas Davidson
_______________________________________________
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.

  • Follow-Ups:
    • Re: Saving ruler markers to defaults
      • From: Jeremy Dronfield <email@hidden>
References: 
 >Saving ruler markers to defaults (From: Jeremy Dronfield <email@hidden>)

  • Prev by Date: Saving ruler markers to defaults
  • Next by Date: Overide NSBrowser NSMatrix Question?
  • Previous by thread: Saving ruler markers to defaults
  • Next by thread: Re: Saving ruler markers to defaults
  • Index(es):
    • Date
    • Thread