• 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: NSGraphicsContext restore crashes my xtension
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSGraphicsContext restore crashes my xtension


  • Subject: Re: NSGraphicsContext restore crashes my xtension
  • From: Ken Tozier <email@hidden>
  • Date: Sun, 27 Jul 2008 21:05:20 -0400


On Jul 27, 2008, at 7:09 PM, glenn andreas wrote:

If you call [NSGraphicsContext currentContext] before your setCurrentContext:, what do you get back?

Whatever that is, that's the context to restore with a second [NSGraphicsContext setCurrentContext: ] at the end...

Pay no attention to what the CGGraphicsContext is - there is no such thing as a "current" CGGraphicsContext (since CGGraphicsContext routines all take the context as an explicit parameter) - it's only the implicit NSGraphicsContext that matters.


Thanks Glenn.

Saving/restoring the context with

*oldContext = [NSGraphicsContext currentContext];

[NSGraphicsContext setCurrentContext: oldContext];

Did the trick. No more crashes.

Thanks again.
_______________________________________________

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


  • Follow-Ups:
    • Re: NSGraphicsContext restore crashes my xtension
      • From: Graham Cox <email@hidden>
References: 
 >Re: NSGraphicsContext restore crashes my xtension (From: email@hidden)
 >Re: NSGraphicsContext restore crashes my xtension (From: glenn andreas <email@hidden>)

  • Prev by Date: Re: IB not recognizing class hierarchy
  • Next by Date: Working with mathematical errors
  • Previous by thread: Re: NSGraphicsContext restore crashes my xtension
  • Next by thread: Re: NSGraphicsContext restore crashes my xtension
  • Index(es):
    • Date
    • Thread