• 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: Make an attributed string all uppercase without losing attributes?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Make an attributed string all uppercase without losing attributes?


  • Subject: Re: Make an attributed string all uppercase without losing attributes?
  • From: Jim Correia <email@hidden>
  • Date: Fri, 8 May 2009 23:11:49 -0400

On Fri, May 8, 2009 at 10:56 PM, Graham Cox <email@hidden> wrote:
> I have an attributed string. I want to preserve the attributes within the
> string but set all the actual characters to uppercase, lowercase, etc.
>
> According to the docs for NSMutableAttributedString, the -mutableString
> method returns a mutable string that the receiver tracks changes to in order
> to preserve attribute runs. However, when I call -setString: or
> -replaceCharactersInRange:withString: on this, all my attributes are
> removed.
>
> How can I do this without my attributes going AWOL?

The documentation for -[NSMutableString
replaceCharactersInRange:withString:] is perhaps more enlightening.

"""The new characters inherit the attributes of the first replaced
character from aRange"""

Processing the string by attribute runs sounds like it should have the
effect you are looking for.

Jim
_______________________________________________

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: Make an attributed string all uppercase without losing attributes?
      • From: Graham Cox <email@hidden>
References: 
 >Make an attributed string all uppercase without losing attributes? (From: Graham Cox <email@hidden>)

  • Prev by Date: Help debugging bindings issues
  • Next by Date: Custom Sheets
  • Previous by thread: Make an attributed string all uppercase without losing attributes?
  • Next by thread: Re: Make an attributed string all uppercase without losing attributes?
  • Index(es):
    • Date
    • Thread