Re: text highlighting with CALayer and NSTextVew
Re: text highlighting with CALayer and NSTextVew
- Subject: Re: text highlighting with CALayer and NSTextVew
- From: Koen van der Drift <email@hidden>
- Date: Thu, 23 Aug 2012 11:28:50 -0400
On Thu, Aug 23, 2012 at 11:23 AM, Kyle Sluder <email@hidden> wrote:
> On Aug 22, 2012, at 5:21 PM, Koen van der Drift <email@hidden> wrote:
>
>> I'd like to add some custom text highlighting to my NSTextView, so I added the following code to the NSTextView init method:
>>
>> CALayer *aLayer = [CALayer layer];
>> [self setWantsLayer: YES];
>> [self setLayer: aLayer];
>
> This isn't going to work. The nib loading machinery enumerates all your views and calls -setWantsLayer: after it has initialized all of them. Put this code in -awakeFromNib instead. (Do you really need to subclass NSTextView here?)
See my response earlier, removing this code completely and turning on
CA in IB did the trick.
- Koen.
_______________________________________________
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