• 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: CGContextSetStyle console log error?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CGContextSetStyle console log error?


  • Subject: Re: CGContextSetStyle console log error?
  • From: Steve Christensen <email@hidden>
  • Date: Fri, 24 Aug 2007 07:51:00 -0700

On Aug 24, 2007, at 1:29 AM, Keith Blount 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

_______________________________________________

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: 
 >CGContextSetStyle console log error? (From: Keith Blount <email@hidden>)

  • Prev by Date: Re: Uppercasing text as it is entered
  • Next by Date: NSScrollView notification
  • Previous by thread: CGContextSetStyle console log error?
  • Next by thread: Re: CGContextSetStyle console log error?
  • Index(es):
    • Date
    • Thread