Tried it, my code looks like this now: CustomLayer *lines = [CustomLayer layer]; [self.view.layer addSublayer:lines]; [lines setNeedsDisplay];
Still nothing. Am I calling setNeedsDisplay at the wrong place? On 2010-02-11, at 5:39 PM, Bob Barnes wrote: > Have you tried calling setNeedsDisplay on the view? You need to request > that a view redraw when the data or state used for drawing a view changes. > > Bob > > On Feb 11, 2010, at 3:44 PM, PCWiz wrote: > >> I'm trying to do some custom drawing in a CALayer subclass by overriding the >> drawInContext: method, but it appears that its not being called. In my >> subclass I just have this: >> >> - (void)drawInContext:(CGContextRef)theContext >> { >> NSLog(@"drawInContext called"); >> } >> >> Then in the viewDidLoad method of my view controller I have this: >> >> CustomLayer *lines = [CustomLayer layer]; >> [self.view.layer addSublayer:lines]; >> >> However, the drawInContext method is never called. What am I doing wrong >> here?_______________________________________________ >> >> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) >> >> 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: >> http://lists.apple.com/mailman/options/cocoa-dev/toadfoot%40comcast.net >> >> This email sent to toadf...@comcast.net > _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com