Re: Setting the Line Height/ Line Spacing in an NSTextView.
Re: Setting the Line Height/ Line Spacing in an NSTextView.
- Subject: Re: Setting the Line Height/ Line Spacing in an NSTextView.
- From: Joshua Garnham <email@hidden>
- Date: Fri, 1 Jan 2010 08:10:04 +0000 (GMT)
That was a spelling mistake, it was meant to say NSMutableParagraphStyle.
I've tried doing this …
CGFloat spacing = 5.0f;
NSMutableParagraphStyle *paragraphStyle;
[paragraphStyle init];
[paragraphStyle setLineSpacing:spacing];
[paragraphStyle setMinimumLineHeight:spacing];
[paragraphStyle setMaximumLineHeight:spacing];
[textView setDefaultParagraphStyle:paragraphStyle]
But I get this error in the debugger:
-[NSSortDescriptor setLineSpacing:]: unrecognized selector sent to instance 0x1b202a0
________________________________
From: Graham Cox <email@hidden>
To: Joshua Garnham <email@hidden>
Cc: Cocoa-Dev List <email@hidden>
Sent: Fri, 1 January, 2010 0:16:04
Subject: Re: Setting the Line Height/ Line Spacing in an NSTextView.
On 01/01/2010, at 5:14 AM, Joshua Garnham wrote:
> So would this work?…
> NSMutablePargagraphStyle *paragraphStyle;
> [paragraphStyle setLineSpacing:spacing];
No - you haven't allocated/inited the paragraphStyle object, nor initialised the variable. Most probably this will crash. Also, there's no such class as NSMutablePargagraphStyle.
I'm guessing this is 'pseudocode', but it's really better not to do that but to write exactly what you mean. It saves a lot of potential misinterpretations.
--Graham
_______________________________________________
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