Re: CGContextSetStyle console log error?
Re: CGContextSetStyle console log error?
- Subject: Re: CGContextSetStyle console log error?
- From: Keith Blount <email@hidden>
- Date: Fri, 24 Aug 2007 13:51:37 -0700 (PDT)
Thanks for your reply, Steve - much appreciated.
NSLog() is my usual (and usually most effective) way
of debugging things like this, but in this case the
CGContextSetStyle log message seems so sporadic that I
could be waiting a long time for it to reappear; I was
hoping there might be some clear-cut situation that
would cause this message, but I guess not - so I'll go
ahead and follow your advice, and hope it crops up
again soon.
If anyone does have any further ideas, of course, I
would be very grateful.
Thanks again and all the best,
Keith
--- email@hidden wrote:
>
> > From time to time my app generates the following
> console error:
> >
> > CGContextSetStyle: invalid context
> >
> > Does anybody know what this means or what it
> indicates I am doing
> > wrong? An internet and archive search reveals
> nothing, and there is
> > nothing about "CGContextSetStyle" in the docs.
> Moreover, I do
> > nothing with CGContext at all in my code. My app
> > includes the Quartz framework only for use of the
> PDFView.
>
> CGContextSetStyle is likely an internal Quartz
> function called by
> some other code, but in any case the console message
> suggests that an
> invalid CGContextRef is being passed to it from
> someplace farther
> back in the call chain. The most likely place would
> be in your code
> where you won't see any CGContextFoo() calls since
> they're wrapped by
> Cocoa methods.
>
> > In fact, the only thing I can think of that has
> anything to do with
> > a graphics context in my code are these lines in a
> custom view, in
> > its -drawRect: method:
> >
> > NSRect patternFrame = [self convertRect:[self
> frame] toView:nil];
> > [[NSGraphicsContext currentContext]
> setPatternPhase: NSMakePoint
> > (patternFrame.origin.x, NSMaxY(patternFrame))];
> >
> > I use the above just so that the background
> colour, if it uses -
> > colorWithPatternImage:, gets drawn with its origin
> in the top-left
> > of the view, otherwise it looks very odd when
> scrolling. I have no
> > idea if the above method could have anything to do
> with this
> > console error, but it seems to be the only place I
> do anything with
> > a context...
>
> If that's the only place where you're drawing, you
> could always add
> NSLog(...) calls to the beginning and end of your
> -drawRect: method
> to see if they bracket the console method you're
> seeing above.
>
> steve
>
____________________________________________________________________________________
Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get online.
http://smallbusiness.yahoo.com/webhosting
_______________________________________________
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