Re: Adding spaces to an NSString
Re: Adding spaces to an NSString
- Subject: Re: Adding spaces to an NSString
- From: "Shawn Erickson" <email@hidden>
- Date: Tue, 18 Mar 2008 21:23:23 -0700
On Tue, Mar 18, 2008 at 5:40 PM, J. Todd Slack
<email@hidden> wrote:
> Hello All,
>
> I am a little stumped today, not sure why, but how would I add a space after
> every character in an NSString and produce a new NSString from it.
>
> So I have something like: (ignore the quotes, I just did it for containment
> sake..)
>
> ³/Users/slack/Music²
>
> And I want it to be:
>
> ³/ U s e r s / s l a c k / M u s i c ³
>
> Would anyone have any thoughts?
Not fully clear... but do you really wants space characters between
each character in the string? Or do you just want the string when
displayed to have a gap between characters?
If the later, then as John hinted at, consider constructing an
NSAttributeString with kerning adjusted to give you the visual spacing
you desire (NSKernAttributeName).
-Shawn
_______________________________________________
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