• 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
Removing NSLinkAttributeName doesn't remove the other attributes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Removing NSLinkAttributeName doesn't remove the other attributes


  • Subject: Removing NSLinkAttributeName doesn't remove the other attributes
  • From: Glen Simmons <email@hidden>
  • Date: Wed, 1 Mar 2006 14:27:53 -0600

I'm handling the addition / editing / removal of links in an NSTextView myself. Adding / editing links works fine, but removing them, not so much. The removal of the link attribute works, but the text is not updated to remove the other attributes (blue color, underline). What am I missing? Here's what I'm doing:

    NSTextStorage*      theTS = [self textStorage];
    NSArray*            selRangesArray = [self selectedRanges];
    unsigned            i, count = [selRangesArray count];
    NSRange             theRange;
    [theTS beginEditing];
    for (i = 0; i < count; i++)
    {
        theRange = [[selRangesArray objectAtIndex:i] rangeValue];
        [theTS removeAttribute:NSLinkAttributeName range:theRange];
    }
    [theTS endEditing];


_______________________________________________ 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: Removing NSLinkAttributeName doesn't remove the other attributes
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: NSBrowser and NSTreeController and column title?
  • Next by Date: Live dragging - Need Help
  • Previous by thread: NSBrowser and NSTreeController and column title?
  • Next by thread: Re: Removing NSLinkAttributeName doesn't remove the other attributes
  • Index(es):
    • Date
    • Thread