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: Fritz Anderson <email@hidden>
- Date: Wed, 30 Dec 2009 11:24:21 -0600
On 30 Dec 2009, at 11:01 AM, Joshua Garnham wrote:
> But the methodssetLineSpacing: and others are NSMutableParagraphStyle methods only.
That's the point. You may _want_ to change the paragraph style's properties, but you can't. Casting the parameter doesn't turn an immutable object into a mutable one.
If you really want to substitute a paragraph style of your own (and please comment on the suggestions that you may not want to), make a mutableCopy, set that up as you wish, and pass it up to super.
You may be misconceiving the need to subclass in Cocoa. Subclassing is rare. Most modifications to object behaviors are done through delegates and property setters; Cocoa provides a lot of them. That's why you're getting told to _call_ setDefaultParagraphStyle:, not _override_ it.
If you explained why you feel you must override, we might be better able to help you.
— F
_______________________________________________
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