• 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: disappearing NSSpellingStateAttributeName
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: disappearing NSSpellingStateAttributeName


  • Subject: Re: disappearing NSSpellingStateAttributeName
  • From: Martin Wierschin <email@hidden>
  • Date: Wed, 18 Jun 2008 14:41:29 -0700

Does anyone know what causes the _clearTemporaryAttributesForCharacterRange method to get called... and have theories on why it's being called in my app and why the NSSpellingStateAttributeName that it is clearing isn't being replaced?

I believe that method should only be called when the character contents of the text storage have changed, not the attributes. I would guess that your syntax coloring (or other attribute modifications) are making their changes within a bracketed edit (eg: while a beginEditing call hasn't been closed by a corresponding endEditing). Basically the edited range/flags are all unioned together so it would all appear as one giant text change to the layout manager. Imagine the call sequence:


NSTextStorage* ts = whatever;
[ts beginEditing];
[ts replaceCharactersInRange:NSMakeRange(0,0) withString:@"x"];
[ts addAttribute:NSWhateverAttributeName value:whatever range:NSMakeRange(0, [ts length])];
[ts endEditing];


When the layout manager is notified from processEditing the editedMask/editedRange will specify both characters and attributes have changed across the whole storage. Thus the layout manager would clear away temporary attributes for the entire storage.

~Martin

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: disappearing NSSpellingStateAttributeName
      • From: Jesse Grosjean <email@hidden>
References: 
 >disappearing NSSpellingStateAttributeName (From: Jesse Grosjean <email@hidden>)

  • Prev by Date: Re: NSKeyedArchiver finishEncoding takes forever
  • Next by Date: Re: [Q] UTF-8, stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding, weirdness
  • Previous by thread: disappearing NSSpellingStateAttributeName
  • Next by thread: Re: disappearing NSSpellingStateAttributeName
  • Index(es):
    • Date
    • Thread