你可以通过调用[[[myView window] graphicsContext] graphicsPort]从NSView获取CGContextRef。然后,你可以从CGContextRef创建一个Cairo上下文。
用Cocoa实现这样的东西
是什么意思? - Caffeinated