• 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: is this string styled?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: is this string styled?


  • Subject: Re: is this string styled?
  • From: Matt Neuburg <email@hidden>
  • Date: Sat, 07 Jan 2006 07:49:10 -0800
  • Thread-topic: is this string styled?

On or about 1/7/06 7:16 AM, thus spake "Camillo Lugaresi"
<email@hidden>:

> On 07/gen/06, at 15:57, Matt Neuburg wrote:
>
>> I have an NSTextView. To save storage space, if what's in the text view is
>> effectively unstyled, I'd like to save just the NSString version of it, not
>> the whole NSAttributedString. Is there a simple way to ask the
>> NSAttributedString: "Are your attributes the same as what I'd get if I took
>> your string, made an NSAttributedString from it using initWithString, and
>> stuck it in that NSTextView?" (The reason I'm having trouble with this is
>> that the attributes of an attributed string made with initWithString form an
>> empty dictionary, but the attributes of that same attributed string when it
>> has passed thru the text view are no longer empty.) m.
>
> First, determine if the entire string is covered by the same
> attribute set using attributesAtIndex:longestEffectiveRange:inRange:.
> If it is, compare that attribute set with the default attribute set
> (which depends on your application).

But what *is* the 'default attribute set'? As I said, when I make an
attributed string with initWithString, its attribute dictionary is empty.
That's the problem. m.

--
matt neuburg, phd = email@hidden, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
AppleScript: the Definitive Guide -
http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt
Take Control of Word 2004, Tiger, and more -
http://www.takecontrolbooks.com/tiger-customizing.html
Subscribe to TidBITS! It's free and smart. http://www.tidbits.com/



 _______________________________________________
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

  • Follow-Ups:
    • Re: is this string styled?
      • From: Jim Correia <email@hidden>
    • Re: is this string styled?
      • From: Camillo Lugaresi <email@hidden>
References: 
 >Re: is this string styled? (From: Camillo Lugaresi <email@hidden>)

  • Prev by Date: Re: Interface declaration
  • Next by Date: one window with two documents
  • Previous by thread: Re: is this string styled?
  • Next by thread: Re: is this string styled?
  • Index(es):
    • Date
    • Thread