• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: text highlighting with CALayer and NSTextVew
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >text highlighting with CALayer and NSTextVew (From: Koen van der Drift <email@hidden>)
 >Re: text highlighting with CALayer and NSTextVew (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: text highlighting with CALayer and NSTextVew
  • Next by Date: Re: Sandboxing die.die.die
  • Previous by thread: Re: text highlighting with CALayer and NSTextVew
  • Next by thread: Issues with NSMutableOrderedSet moveObjectsAtIndexes:toIndex:
  • Index(es):
    • Date
    • Thread