Re: [iPhone] custom CALayer drawing

2010-02-11 Thread PCWiz
Thanks, setting the layer frame to an appropriate size did the trick :) Independent Cocoa Developer, Macatomy Software http://macatomy.com On 2010-02-11, at 5:55 PM, David Duncan wrote: > On Feb 11, 2010, at 4:50 PM, PCWiz wrote: > >> Yep, I just tried that (sent a reply a minute ago) but the

Re: [iPhone] custom CALayer drawing

2010-02-11 Thread David Duncan
On Feb 11, 2010, at 4:50 PM, PCWiz wrote: > Yep, I just tried that (sent a reply a minute ago) but the drawInContext: > method still isn't being called. Its because your layer is still sized 0,0. Not much you can draw into a layer that size :). -- David Duncan Apple DTS Animation and Printing

Re: [iPhone] custom CALayer drawing

2010-02-11 Thread PCWiz
Yep, I just tried that (sent a reply a minute ago) but the drawInContext: method still isn't being called. Independent Cocoa Developer, Macatomy Software http://macatomy.com On 2010-02-11, at 5:47 PM, David Duncan wrote: > On Feb 11, 2010, at 3:44 PM, PCWiz wrote: > >> I'm trying to do some

Re: [iPhone] custom CALayer drawing

2010-02-11 Thread PCWiz
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

Re: [iPhone] custom CALayer drawing

2010-02-11 Thread David Duncan
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: > > However, the drawInContext method is never called. What am I doing w

Re: [iPhone] custom CALayer drawing

2010-02-11 Thread Bob Barnes
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: met

[iPhone] custom CALayer drawing

2010-02-11 Thread PCWiz
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