NSGraphicsContext

Crowd-sourced documentation and tutorials by the Cocoa developer community
Jump to: navigation, search

ApplicationKit/Classes/NSGraphicsContext_Class/index.html

The NSGraphicsContext class is the programmatic interface to objects that represent graphics contexts.



To avoid the following error in the console:

unlockFocus called too many time

Make sure you're saving/restoring the graphics context properly. Example:

[[[NSGraphicsContext]] saveGraphicsState];

[[[NSGraphicsContext]] setCurrentContext:[[[NSGraphicsContext]] graphicsContextWithGraphicsPort:context flipped:NO]];

// draw something

[[[NSGraphicsContext]] restoreGraphicsState];

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox