Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Monaj

macrumors regular
Original poster
May 24, 2009
193
0
hi all,

I am caught in a small problem.

When I am assigning normal values to a text field using setStringValue and making the text right aligned through IB, it works fine! But when I try to assign it NSAttributedString using setAttributedStringValue: the text appears in correct color and font but does not appear to be right aligned, it always appear to be left aligned irrespective of any setting in IB.:eek:
I have tried to do it via code using setAllignment:NSRightTextAllignment and event tried to look for suitable methods in class references but cannot find one.

Can anyone suggest me the appropriate method:confused:

Thanks in advance,

Manoj
 
You could try providing a custom NSParagraphStyle for the attributed string, and use its setAlignment: method instead.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.